Documentation ¶
Index ¶
- Constants
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func Panic(format string, args ...interface{})
- func ResetDefault(loggerGroup LoggerGroup)
- func Warn(format string, args ...interface{})
- type Config
- type Fields
- type Logger
- type LoggerGroup
Constants ¶
View Source
const ( LogDefaultName = "default" LogFormatText = "text" LogFormatJSON = "json" LogConsoleWriter = "console" LogFileWriter = "file" )
Variables ¶
This section is empty.
Functions ¶
func ResetDefault ¶
func ResetDefault(loggerGroup LoggerGroup)
Types ¶
type Config ¶
type Config struct { Name string Writers []string LogFile string LogLevel string LogFormat string StackTraceLevel string MaxSize int MaxBackups int MaxDays int Compress bool }
Config is used for logging settings
type Logger ¶
type Logger interface { ResetLogger(logger Logger) SetFields(Fields) GetFields() Fields GetField(string) (interface{}, bool) WithField(string, interface{}) Logger WithFields(Fields) Logger WithError(error) Logger Debug(string, ...interface{}) Info(string, ...interface{}) Warn(string, ...interface{}) Error(string, ...interface{}) Panic(string, ...interface{}) Fatal(string, ...interface{}) }
Logger is the log interface
func NewZapLogger ¶
func WithFields ¶
type LoggerGroup ¶
type LoggerGroup interface { GetLogger(name string, useDefault ...bool) (Logger, bool) Default() Logger }
func NewZapLoggerGroup ¶
func NewZapLoggerGroup(configs []Config, fields ...Fields) LoggerGroup
Click to show internal directories.
Click to hide internal directories.