Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Debugw(keyvals ...interface{})
- func Error(args ...interface{})
- func Errorf(msg string, args ...interface{})
- func Errorw(keyvals ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Fatalw(keyvals ...interface{})
- func Flush() error
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func Infow(keyvals ...interface{})
- func Panic(args ...interface{})
- func Panicf(msg string, args ...interface{})
- func Panicw(keyvals ...interface{})
- func Print(args ...interface{})
- func Printf(msg string, args ...interface{})
- func Printw(keyvals ...interface{})
- func SetConfig(config Config)
- func SetDefaultAdapter(adapter *Adapter)
- func SetDefaultLogger(logger Logger)
- func SetLevel(name, lvl string)
- func Warn(args ...interface{})
- func Warnf(msg string, args ...interface{})
- func Warnw(keyvals ...interface{})
- type Adapter
- func (la *Adapter) Close() error
- func (la *Adapter) Debug(args ...interface{})
- func (la *Adapter) Debugf(msg string, args ...interface{})
- func (la *Adapter) Debugw(keyvals ...interface{})
- func (la *Adapter) Enabled(l Level) bool
- func (la *Adapter) Error(args ...interface{})
- func (la *Adapter) Errorf(msg string, args ...interface{})
- func (la *Adapter) Errorw(keyvals ...interface{})
- func (la *Adapter) Fatal(args ...interface{})
- func (la *Adapter) Fatalf(msg string, args ...interface{})
- func (la *Adapter) Fatalw(keyvals ...interface{})
- func (la *Adapter) Flush() error
- func (la *Adapter) Info(args ...interface{})
- func (la *Adapter) Infof(msg string, args ...interface{})
- func (la *Adapter) Infow(keyvals ...interface{})
- func (la *Adapter) Level() Level
- func (la *Adapter) Log(_ context.Context, level Level, msg string, keyValues ...interface{})
- func (la *Adapter) Panic(args ...interface{})
- func (la *Adapter) Panicf(msg string, args ...interface{})
- func (la *Adapter) Panicw(keyvals ...interface{})
- func (la *Adapter) Print(args ...interface{})
- func (la *Adapter) Printf(msg string, args ...interface{})
- func (la *Adapter) Printw(keyvals ...interface{})
- func (la *Adapter) SetLevel(l Level) *Adapter
- func (la *Adapter) Warn(args ...interface{})
- func (la *Adapter) Warnf(msg string, args ...interface{})
- func (la *Adapter) Warnw(keyvals ...interface{})
- type AtomicLevel
- type Config
- type Level
- type Logger
- type Option
- type ZapConfig
Constants ¶
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = zapcore.DebugLevel // InfoLevel is the default logging priority. InfoLevel = zapcore.InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = zapcore.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = zapcore.ErrorLevel // PanicLevel logs a message, then panics. PanicLevel = zapcore.PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zapcore.FatalLevel )
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug uses fmt.Sprint to construct and logger a message.
func Debugf ¶
func Debugf(msg string, args ...interface{})
Debugf uses fmt.Sprintf to logger a templated message.
func Debugw ¶ added in v0.0.3
func Debugw(keyvals ...interface{})
Debugw uses key,value to construct and logger a message.
func Error ¶
func Error(args ...interface{})
Error uses fmt.Sprint to construct and logger a message.
func Errorf ¶
func Errorf(msg string, args ...interface{})
Errorf uses fmt.Sprintf to logger a templated message.
func Errorw ¶ added in v0.0.3
func Errorw(keyvals ...interface{})
Errorw uses key,value to construct and logger a message.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and logger a message, then calls os.Exit.
func Fatalf ¶
func Fatalf(msg string, args ...interface{})
Fatalf uses fmt.Sprintf to logger a templated message, then calls os.Exit.
func Fatalw ¶ added in v0.0.3
func Fatalw(keyvals ...interface{})
Fatalw uses key,value to construct and logger a message.
func Flush ¶
func Flush() error
Flush flushing any buffered log entries. Applications should take care to call Sync before exiting.
func Infof ¶
func Infof(msg string, args ...interface{})
Infof uses fmt.Sprintf to logger a templated message.
func Infow ¶ added in v0.0.3
func Infow(keyvals ...interface{})
Infow uses key,value to construct and logger a message.
func Panic ¶
func Panic(args ...interface{})
Panic uses fmt.Sprint to construct and logger a message, then panics.
func Panicf ¶
func Panicf(msg string, args ...interface{})
Panicf uses fmt.Sprintf to logger a templated message, then panics.
func Panicw ¶ added in v0.0.3
func Panicw(keyvals ...interface{})
Panicw uses key,value to construct and logger a message.
func Print ¶
func Print(args ...interface{})
Print uses fmt.Sprint to construct and logger a message.
func Printf ¶
func Printf(msg string, args ...interface{})
Printf uses fmt.Sprintf to logger a templated message.
func Printw ¶ added in v0.0.3
func Printw(keyvals ...interface{})
Printw uses key,value to construct and logger a message.
func SetDefaultAdapter ¶ added in v0.0.3
func SetDefaultAdapter(adapter *Adapter)
func SetDefaultLogger ¶ added in v0.0.3
func SetDefaultLogger(logger Logger)
Types ¶
type Adapter ¶ added in v0.0.3
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶ added in v0.0.3
NewAdapter new a logger adapter.
func (*Adapter) Debug ¶ added in v0.0.3
func (la *Adapter) Debug(args ...interface{})
Debug uses fmt.Sprint to construct and logger a message.
func (*Adapter) Debugw ¶ added in v0.0.3
func (la *Adapter) Debugw(keyvals ...interface{})
Debugw uses key,value to construct and logger a message.
func (*Adapter) Enabled ¶ added in v0.0.3
Enabled implements the zapcore.LevelEnabler interface, which allows the AtomicLevel to be used in place of traditional static levels.
func (*Adapter) Error ¶ added in v0.0.3
func (la *Adapter) Error(args ...interface{})
Error uses fmt.Sprint to construct and logger a message.
func (*Adapter) Errorw ¶ added in v0.0.3
func (la *Adapter) Errorw(keyvals ...interface{})
Errorw uses key,value to construct and logger a message.
func (*Adapter) Fatal ¶ added in v0.0.3
func (la *Adapter) Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and logger a message, then calls os.Exit.
func (*Adapter) Fatalf ¶ added in v0.0.3
Fatalf uses fmt.Sprintf to logger a templated message, then calls os.Exit.
func (*Adapter) Fatalw ¶ added in v0.0.3
func (la *Adapter) Fatalw(keyvals ...interface{})
Fatalw uses key,value to construct and logger a message.
func (*Adapter) Flush ¶ added in v0.0.3
Flush flushing any buffered log entries. Applications should take care to call Sync before exiting.
func (*Adapter) Info ¶ added in v0.0.3
func (la *Adapter) Info(args ...interface{})
Info uses fmt.Sprint to construct and logger a message.
func (*Adapter) Infow ¶ added in v0.0.3
func (la *Adapter) Infow(keyvals ...interface{})
Infow uses key,value to construct and logger a message.
func (*Adapter) Panic ¶ added in v0.0.3
func (la *Adapter) Panic(args ...interface{})
Panic uses fmt.Sprint to construct and logger a message, then panics.
func (*Adapter) Panicf ¶ added in v0.0.3
Panicf uses fmt.Sprintf to logger a templated message, then panics.
func (*Adapter) Panicw ¶ added in v0.0.3
func (la *Adapter) Panicw(keyvals ...interface{})
Panicw uses key,value to construct and logger a message.
func (*Adapter) Print ¶ added in v0.0.3
func (la *Adapter) Print(args ...interface{})
Print uses fmt.Sprint to construct and logger a message.
func (*Adapter) Printw ¶ added in v0.0.3
func (la *Adapter) Printw(keyvals ...interface{})
Printw uses key,value to construct and logger a message.
func (*Adapter) Warn ¶ added in v0.0.3
func (la *Adapter) Warn(args ...interface{})
Warn uses fmt.Sprint to construct and logger a message.
type AtomicLevel ¶ added in v0.0.4
type AtomicLevel = zap.AtomicLevel
AtomicLevel is an atomically changeable, dynamic logging level. It lets you
type Logger ¶
type Logger interface { io.Closer // Log logs a message at a given level. Log(ctx context.Context, level Level, msg string, keyValues ...interface{}) }
Logger is a logger interface.
var NopLogger Logger = nopLogger{}
NopLogger is a logger that does nothing.