Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, fields Fields)
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, fields Fields)
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, fields Fields)
- func GetLogger() *zap.SugaredLogger
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, fields Fields)
- func Init(opts Opts, logPaths ...string) (err error)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, fields Fields)
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, fields Fields)
- type Fields
- type Level
- type Opts
Constants ¶
View Source
const ( DebugLevel = "DEBUG" InfoLevel = "INFO" WarnLevel = "WARN" ErrorLevel = "ERROR" FatalLevel = "FATAL" PanicLevel = "PANIC" )
Wrap the log levels so you only have to import this library
Variables ¶
View Source
var Default = Opts{ Level: InfoLevel, CallerSkip: 1, MaxLogSize: 10, MaxLogBackups: 5, CompressBackupLogs: false, Console: true, }
Default is the default config for on the fly use
Functions ¶
func GetLogger ¶ added in v1.1.0
func GetLogger() *zap.SugaredLogger
GetLogger will return an instance of the logger in case we need to plug it in somewhere
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields are key values that we will decorate the message with
type Level ¶
type Level string
Level is a simple wrapper for log levels so you just import this library
type Opts ¶
type Opts struct { Level Level `` /* 166-byte string literal not displayed */ MaxLogSize int `` /* 129-byte string literal not displayed */ MaxLogBackups int `json:"log_max_backups" env:"log_max_backups" default:"5" description:"Max number of backups to keep"` CompressBackupLogs bool `json:"log_compress_backups" env:"log_compress_backups" default:"false" description:"Whether to compress backups or not"` Console bool `` /* 139-byte string literal not displayed */ CallerSkip int `` /* 186-byte string literal not displayed */ }
Opts are options you can configure the logger with
Click to show internal directories.
Click to hide internal directories.