Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetStandardLogger ¶
func SetStandardLogger(l Logger)
SetStandardLogger sets the global logger's output to a custom logger instance.
Types ¶
type Config ¶
type Config struct { // Format specifies the output log format. // Accepted values are: json, text(default). Format string // Level is the minimum log level that should appear on the output. Level string // NoColor makes sure that no log output gets colorized. NoColor bool }
Config holds details necessary for logging.
type Logger ¶
type Logger interface { logur.Logger // Format strings Tracef(format string, args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) // WithFields returns a new logger with fields added to the current logger. WithFields(fields map[string]interface{}) Logger // WithField is a shortcut for WithFields(map[string]interface{}{key: value}). WithField(key string, value interface{}) Logger // WithContext = Ctx 从context中读取request_id Ctx(ctx context.Context) Logger // WithError = Err returns a new logger with the given error added to the current logger. Err(err error) Logger }
Click to show internal directories.
Click to hide internal directories.