Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(message string, fields ...zapcore.Field)
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(message string, fields ...zapcore.Field)
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(message string, fields ...zapcore.Field)
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(message string, fields ...zapcore.Field)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(message string, fields ...zapcore.Field)
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(message string, fields ...zapcore.Field)
- type Logger
- func (logger *Logger) Close() (err error)
- func (logger *Logger) Debug(args ...interface{})
- func (logger *Logger) Debugf(template string, args ...interface{})
- func (logger *Logger) Debugw(message string, fields ...zapcore.Field)
- func (logger *Logger) Error(args ...interface{})
- func (logger *Logger) Errorf(template string, args ...interface{})
- func (logger *Logger) Errorw(message string, fields ...zapcore.Field)
- func (logger *Logger) Fatal(args ...interface{})
- func (logger *Logger) Fatalf(template string, args ...interface{})
- func (logger *Logger) Fatalw(message string, fields ...zapcore.Field)
- func (logger *Logger) Info(args ...interface{})
- func (logger *Logger) Infof(template string, args ...interface{})
- func (logger *Logger) Infow(message string, fields ...zapcore.Field)
- func (logger *Logger) Panic(args ...interface{})
- func (logger *Logger) Panicf(template string, args ...interface{})
- func (logger *Logger) Panicw(message string, fields ...zapcore.Field)
- func (logger *Logger) SkipFrames(frames int) *Logger
- func (logger *Logger) SkipFramesOnce(frames int) *Logger
- func (logger *Logger) Sync() (err error)
- func (logger *Logger) Warn(args ...interface{})
- func (logger *Logger) Warnf(template string, args ...interface{})
- func (logger *Logger) Warnw(message string, fields ...zapcore.Field)
- func (logger *Logger) ZapLogger() *zap.Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Error ¶
func Error(args ...interface{})
Error uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Info ¶
func Info(args ...interface{})
Info uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Panic ¶
func Panic(args ...interface{})
Panic uses the fmt.Sprint to construct and log a message using the DefaultLogger.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses the fmt.Sprintf to log a templated message using the DefaultLogger.
func Warn ¶
func Warn(args ...interface{})
Warn uses the fmt.Sprint to construct and log a message using the DefaultLogger.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a log object, which exposes standard APIs like errorf, error, warn, warnf and etcd.
var ( // DefaultLogger is the default logger, which logs message to stderr and with // the minimal level "warn". DefaultLogger *Logger )
func SkipFrames ¶
func SkipFramesOnce ¶
func (*Logger) Debug ¶
func (logger *Logger) Debug(args ...interface{})
Debug uses the fmt.Sprint to construct and log a message.
func (*Logger) Error ¶
func (logger *Logger) Error(args ...interface{})
Error uses the fmt.Sprint to construct and log a message.
func (*Logger) Fatal ¶
func (logger *Logger) Fatal(args ...interface{})
Fatal uses the fmt.Sprint to construct and log a message and followed by a call to os.Exit(1).
func (*Logger) Fatalf ¶
Fatalf uses the fmt.Sprintf to log a templated message and followed by a call to os.Exit(1).
func (*Logger) Fatalw ¶
Fatalw logs a message with some additional context and followed by a call to os.Exit(1).
func (*Logger) Info ¶
func (logger *Logger) Info(args ...interface{})
Info uses the fmt.Sprint to construct and log a message.
func (*Logger) Panic ¶
func (logger *Logger) Panic(args ...interface{})
Panic uses the fmt.Sprint to construct and log a message and followed by a call to panic().
func (*Logger) Panicf ¶
Panicf uses the fmt.Sprintf to log a templated message and followed by a call to panic().
func (*Logger) Panicw ¶
Panicw logs a message with some additional context and followed by a call to panic().
func (*Logger) SkipFrames ¶
func (*Logger) SkipFramesOnce ¶
func (*Logger) Warn ¶
func (logger *Logger) Warn(args ...interface{})
Warn uses the fmt.Sprint to construct and log a message.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures how to set up logger.
func WithOutputFile ¶
WithOutputFile sets the output file path.
func WithSkipFrames ¶
WithSkipFrames sets the number frames that will be skipped when printing the file and line information.
func WithTimeEncoder ¶
WithTimeEncoder sets the time encoder
func WithWriteSyncer ¶
func WithWriteSyncer(ws zapcore.WriteSyncer) Option
WithWriteSyncer is a low level API which sets the underlying WriteSyncer by providing a zapcore.WriterSyncer, which has high priority than WithOutputFile.