Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Init(path, level string, options ...Option)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Sync()
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- type Configuration
- type Logger
- type Option
- type SLogger
- func (l *SLogger) DPanic(args ...interface{})
- func (l *SLogger) DPanicf(template string, args ...interface{})
- func (l *SLogger) DPanicw(msg string, keysAndValues ...interface{})
- func (l *SLogger) Debug(args ...interface{})
- func (l *SLogger) Debugf(template string, args ...interface{})
- func (l *SLogger) Debugw(msg string, keysAndValues ...interface{})
- func (l *SLogger) Error(args ...interface{})
- func (l *SLogger) Errorf(template string, args ...interface{})
- func (l *SLogger) Errorw(msg string, keysAndValues ...interface{})
- func (l *SLogger) Fatal(args ...interface{})
- func (l *SLogger) Fatalf(template string, args ...interface{})
- func (l *SLogger) Fatalw(msg string, keysAndValues ...interface{})
- func (l *SLogger) Info(args ...interface{})
- func (l *SLogger) Infof(template string, args ...interface{})
- func (l *SLogger) Infow(msg string, keysAndValues ...interface{})
- func (l *SLogger) Panic(args ...interface{})
- func (l *SLogger) Panicf(template string, args ...interface{})
- func (l *SLogger) Panicw(msg string, keysAndValues ...interface{})
- func (l *SLogger) Sync() error
- func (l *SLogger) Warn(args ...interface{})
- func (l *SLogger) Warnf(template string, args ...interface{})
- func (l *SLogger) Warnw(msg string, keysAndValues ...interface{})
- type ZapLogger
- func (l *ZapLogger) Build()
- func (l *ZapLogger) DPanic(args ...interface{})
- func (l *ZapLogger) DPanicf(template string, args ...interface{})
- func (l *ZapLogger) DPanicw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Debug(args ...interface{})
- func (l *ZapLogger) Debugf(template string, args ...interface{})
- func (l *ZapLogger) Debugw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Error(args ...interface{})
- func (l *ZapLogger) Errorf(template string, args ...interface{})
- func (l *ZapLogger) Errorw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Fatal(args ...interface{})
- func (l *ZapLogger) Fatalf(template string, args ...interface{})
- func (l *ZapLogger) Fatalw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Info(args ...interface{})
- func (l *ZapLogger) Infof(template string, args ...interface{})
- func (l *ZapLogger) Infow(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Panic(args ...interface{})
- func (l *ZapLogger) Panicf(template string, args ...interface{})
- func (l *ZapLogger) Panicw(msg string, keysAndValues ...interface{})
- func (l *ZapLogger) Sync() error
- func (l *ZapLogger) Warn(args ...interface{})
- func (l *ZapLogger) Warnf(template string, args ...interface{})
- func (l *ZapLogger) Warnw(msg string, keysAndValues ...interface{})
Constants ¶
View Source
const ( DebugLevel = "debug" InfoLevel = "info" WarnLevel = "warn" ErrorLevel = "error" PanicLevel = "panic" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶ added in v1.0.2
type Logger ¶ added in v1.0.1
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Panic(args ...interface{}) Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Warnf(template string, args ...interface{}) Errorf(template string, args ...interface{}) Panicf(template string, args ...interface{}) Sync() error }
type Option ¶
type Option func(c *Configuration)
func SetCompress ¶
func SetMaxBackups ¶
func SetMaxFileSize ¶
type SLogger ¶ added in v1.0.2
type SLogger struct {
// contains filtered or unexported fields
}
func NewSLogger ¶ added in v1.0.2
func NewSLogger(c *Configuration) *SLogger
type ZapLogger ¶ added in v1.0.2
type ZapLogger struct { *Configuration // contains filtered or unexported fields }
ZapLogger 默认会使用zap作为日志输出引擎. Log集成了日志切割的功能。默认文件大小512M,自动压缩
func NewZapLogger ¶ added in v1.0.2
func NewZapLogger(c *Configuration) *ZapLogger
NewZapLogger new ZapLogger
Click to show internal directories.
Click to hide internal directories.