log

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: AGPL-3.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package log provides structured logging based on Zap.

It supports console and file output with log rotation, multiple log levels, trace context propagation, and adapters for GORM and Gin. Use Info/Error/Debug etc. as top-level functions for quick logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Debug

func Debug(msg string, keysAndValues ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(msg string, keysAndValues ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Info

func Info(msg string, keysAndValues ...interface{})

func Infof

func Infof(format string, args ...interface{})

func Json

func Json(data any)

func Panic

func Panic(msg string, keysAndValues ...interface{})

func Panicf

func Panicf(format string, args ...interface{})

func Print

func Print(args ...interface{})

func Sync

func Sync()

func Warn

func Warn(msg string, keysAndValues ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

func Zaplog

func Zaplog() *zap.Logger

Types

type GinLogger

type GinLogger struct {
	// contains filtered or unexported fields
}

GinLogger

func GinAdapter

func GinAdapter() *GinLogger

func (*GinLogger) Write

func (g *GinLogger) Write(p []byte) (n int, err error)

type GormLogger

type GormLogger struct {
	// contains filtered or unexported fields
}

GormLogger

func GormAdapter

func GormAdapter() *GormLogger

func (*GormLogger) Printf

func (g *GormLogger) Printf(format string, args ...interface{})

type LogInstance

type LogInstance struct {
	// contains filtered or unexported fields
}

LogInstance

func Trace

func Trace(traceKey ...string) *LogInstance

func (*LogInstance) Debug

func (l *LogInstance) Debug(msg string, keysAndValues ...interface{})

func (*LogInstance) Debugf

func (l *LogInstance) Debugf(format string, args ...interface{})

func (*LogInstance) Error

func (l *LogInstance) Error(err error, msg string, keysAndValues ...interface{})

func (*LogInstance) Errorf

func (l *LogInstance) Errorf(format string, args ...interface{})

func (*LogInstance) Info

func (l *LogInstance) Info(msg string, keysAndValues ...interface{})

func (*LogInstance) Infof

func (l *LogInstance) Infof(format string, args ...interface{})

func (*LogInstance) Panic

func (l *LogInstance) Panic(msg string, keysAndValues ...interface{})

func (*LogInstance) Panicf

func (l *LogInstance) Panicf(format string, args ...interface{})

func (*LogInstance) Sync

func (l *LogInstance) Sync()

func (*LogInstance) Warn

func (l *LogInstance) Warn(msg string, keysAndValues ...interface{})

func (*LogInstance) Warnf

func (l *LogInstance) Warnf(format string, args ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL