Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(msg string, fields ...Field)
- func Error(msg string, fields ...Field)
- func Fatal(msg string, fields ...Field)
- func Info(msg string, fields ...Field)
- func NewContext(parent context.Context, fields ...Field) context.Context
- func Panic(msg string, fields ...Field)
- func SetDefault(logger Logger)
- func Warn(msg string, fields ...Field)
- type Field
- type Formatter
- type Level
- type Logger
- func (l Logger) Debug(msg string, fields ...Field)
- func (l Logger) Error(msg string, fields ...Field)
- func (l Logger) Fatal(msg string, fields ...Field)
- func (l Logger) Info(msg string, fields ...Field)
- func (l Logger) Log(logLevel Level, msg string, fields ...Field)
- func (l Logger) Panic(msg string, fields ...Field)
- func (l Logger) ParseLevel(level string) (Level, error)
- func (l Logger) Std() StdLogger
- func (l Logger) Warn(msg string, fields ...Field)
- func (l Logger) With(fields ...Field) Logger
- func (l Logger) WithContext(ctx context.Context) Logger
- type Option
- type StdLogger
- func (l StdLogger) Fatal(v ...any)
- func (l StdLogger) Fatalf(format string, v ...any)
- func (l StdLogger) Fatalln(v ...any)
- func (l StdLogger) Panic(v ...any)
- func (l StdLogger) Panicf(format string, v ...any)
- func (l StdLogger) Panicln(v ...any)
- func (l StdLogger) Print(v ...any)
- func (l StdLogger) Printf(format string, v ...any)
- func (l StdLogger) Println(v ...any)
Constants ¶
View Source
const ( InfoLevel = zap.InfoLevel // 0, default level WarnLevel = zap.WarnLevel // 1 ErrorLevel = zap.ErrorLevel // 2 // PanicLevel logs a message, then panics. PanicLevel = zap.PanicLevel // 4 // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zap.FatalLevel // 5 DebugLevel = zap.DebugLevel // -1 )
Variables ¶
View Source
var ( Any = zap.Any Array = zap.Array Binary = zap.Binary Bool = zap.Bool Bools = zap.Bools ByteString = zap.ByteString ByteStrings = zap.ByteStrings Complex64 = zap.Complex64 Complex64s = zap.Complex64s Complex128 = zap.Complex128 Complex128s = zap.Complex128s Duration = zap.Duration Durations = zap.Durations Err = zap.Error Errs = zap.Errors Float32 = zap.Float32 Float32s = zap.Float32s Float64 = zap.Float64 Float64s = zap.Float64s Int = zap.Int Ints = zap.Ints Int8 = zap.Int8 Int8s = zap.Int8s Int16 = zap.Int16 Int16s = zap.Int16s Int32 = zap.Int32 Int32s = zap.Int32s Int64 = zap.Int64 Int64s = zap.Int64s NamedErr = zap.NamedError Namespace = zap.Namespace Stack = zap.Stack String = zap.String Stringer = zap.Stringer Strings = zap.Strings Time = zap.Time Times = zap.Times Uint = zap.Uint Uints = zap.Uints Uint8 = zap.Uint8 Uint8s = zap.Uint8s Uint16 = zap.Uint16 Uint16s = zap.Uint16s Uint32 = zap.Uint32 Uint32s = zap.Uint32s Uint64 = zap.Uint64 Uint64s = zap.Uint64s Uintptr = zap.Uintptr Uintptrs = zap.Uintptrs )
Functions ¶
func SetDefault ¶
func SetDefault(logger Logger)
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewNilLogger ¶
func NewNilLogger() Logger
func WithContext ¶
Click to show internal directories.
Click to hide internal directories.