Documentation ¶
Index ¶
- Variables
- func LevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func NewContext(ctx context.Context, l Log) context.Context
- func ParseEncoder(e string) encoder
- func ParseLevel(l string) level
- func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- type Log
- type Option
- type Options
- type Uber
- func (u *Uber) Clone() Log
- func (u *Uber) Debug(keysAndValues ...interface{})
- func (u *Uber) Debugf(format string, a ...interface{})
- func (u *Uber) Debugw(msg string, keysAndValues ...interface{})
- func (u *Uber) Error(keysAndValues ...interface{})
- func (u *Uber) Errorf(format string, a ...interface{})
- func (u *Uber) Errorw(msg string, keysAndValues ...interface{})
- func (u *Uber) Flush() error
- func (u *Uber) Info(keysAndValues ...interface{})
- func (u *Uber) Infof(format string, a ...interface{})
- func (u *Uber) Infow(msg string, keysAndValues ...interface{})
- func (u *Uber) Warn(keysAndValues ...interface{})
- func (u *Uber) Warnf(format string, a ...interface{})
- func (u *Uber) Warnw(msg string, keysAndValues ...interface{})
- func (u *Uber) With(keysAndValues ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DEG level = "debug" INF level = "info" WRN level = "warn" ERR level = "error" )
View Source
var ( JSON encoder = "json" Console encoder = "console" )
View Source
var ( // DefaultLog default use uber log Logger = NewLog() )
Functions ¶
func LevelEncoder ¶
func LevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
LevelEncoder format level name
func NewContext ¶
NewContext put Log to context
func TimeEncoder ¶
func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
TimeEncoder format time
Types ¶
type Log ¶
type Log interface { Debug(keysAndValues ...interface{}) Debugw(msg string, keysAndValues ...interface{}) Debugf(format string, a ...interface{}) Info(keysAndValues ...interface{}) Infow(msg string, keysAndValues ...interface{}) Infof(format string, a ...interface{}) Warn(keysAndValues ...interface{}) Warnw(msg string, keysAndValues ...interface{}) Warnf(format string, a ...interface{}) Error(keysAndValues ...interface{}) Errorw(msg string, keysAndValues ...interface{}) Errorf(format string, a ...interface{}) With(keysAndValues ...interface{}) Flush() error Clone() Log }
Log interface
func FromContext ¶
FromContext get Log from context
type Options ¶
type Options struct { Encoder encoder Level level MessageKey string LevelKey string TimeKey string NameKey string CallerKey string StacktraceKey string LineEnding string EncodeLevel zapcore.LevelEncoder EncodeTime zapcore.TimeEncoder EncodeDuration zapcore.DurationEncoder EncodeCaller zapcore.CallerEncoder EncodeName zapcore.NameEncoder Filename string MaxSize int MaxAge int MaxBackups int LocalTime bool Compress bool }
Options uber log
type Uber ¶
type Uber struct {
// contains filtered or unexported fields
}
Uber log
Click to show internal directories.
Click to hide internal directories.