Documentation ¶
Index ¶
- Constants
- func BindFlags(flags *pflag.FlagSet)
- func BindGoFlags()
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func IsDebugEnabled() bool
- func IsJsonLogs() bool
- func IsLevelEnabled(level int) bool
- func IsTraceEnabled() bool
- func NewZapEncoder() zapcore.Encoder
- func Prettyf(msg string, obj interface{})
- func Secretf(format string, args ...interface{})
- func SetLogger(logger Logger)
- func Tracef(format string, args ...interface{})
- func UseLogsrus()
- func UseZap()
- func Warnf(format string, args ...interface{})
- type Logger
- type Verbose
- type ZapLogger
- func (zap ZapLogger) Debugf(format string, args ...interface{})
- func (zap ZapLogger) Errorf(format string, args ...interface{})
- func (zap ZapLogger) Fatalf(format string, args ...interface{})
- func (z ZapLogger) GetLevel() int
- func (zap ZapLogger) Infof(format string, args ...interface{})
- func (zap ZapLogger) IsDebugEnabled() bool
- func (z ZapLogger) IsLevelEnabled(level int) bool
- func (zap ZapLogger) IsTraceEnabled() bool
- func (z ZapLogger) Named(name string) Logger
- func (zap ZapLogger) Prettyf(msg string, obj interface{})
- func (zap ZapLogger) Secretf(format string, args ...interface{})
- func (zap ZapLogger) SetLogLevel(level int)
- func (zap ZapLogger) SetMinLogLevel(level int)
- func (zap ZapLogger) Tracef(format string, args ...interface{})
- func (zap ZapLogger) V(level int) Verbose
- func (zap ZapLogger) Warnf(format string, args ...interface{})
- func (z ZapLogger) WithEncoder(encoder zapcore.Encoder) ZapLogger
- func (z ZapLogger) WithSkipReportLevel(i int) Logger
- func (zap ZapLogger) WithValues(keysAndValues ...interface{}) Logger
- func (z ZapLogger) WithoutName() Logger
Constants ¶
View Source
const ( Cyan = cyan + Normal Magenta = magenta + Normal DarkWhite = "\x1b[38;5;244m" Normal = "m" Reset = "\x1b[0m" )
View Source
const TraceLevel = zapcore.DebugLevel - 1
Variables ¶
This section is empty.
Functions ¶
func BindGoFlags ¶ added in v1.21.2
func BindGoFlags()
func IsDebugEnabled ¶
func IsDebugEnabled() bool
func IsJsonLogs ¶ added in v1.20.1
func IsJsonLogs() bool
func IsLevelEnabled ¶ added in v1.20.1
func IsTraceEnabled ¶
func IsTraceEnabled() bool
func NewZapEncoder ¶ added in v1.20.2
func Prettyf ¶ added in v1.3.0
func Prettyf(msg string, obj interface{})
Prettyf is like Tracef, but pretty prints the entire struct
func Secretf ¶ added in v1.3.0
func Secretf(format string, args ...interface{})
Secretf is like Tracef, but attempts to strip any secrets from the text
func UseLogsrus ¶ added in v1.20.1
func UseLogsrus()
Types ¶
type Logger ¶
type Logger interface { Warnf(format string, args ...interface{}) Infof(format string, args ...interface{}) Errorf(format string, args ...interface{}) Debugf(format string, args ...interface{}) Tracef(format string, args ...interface{}) Fatalf(format string, args ...interface{}) WithValues(keysAndValues ...interface{}) Logger IsTraceEnabled() bool IsDebugEnabled() bool IsLevelEnabled(level int) bool GetLevel() int SetLogLevel(level int) SetMinLogLevel(level int) V(level int) Verbose Named(name string) Logger WithoutName() Logger WithSkipReportLevel(i int) Logger }
func NewLogrusLogger ¶ added in v1.4.1
func NewLogrusLogger(existing logrusapi.Ext1FieldLogger, level int) Logger
func StandardLogger ¶
func StandardLogger() Logger
func WithValues ¶ added in v1.4.2
func WithValues(keysAndValues ...interface{}) Logger
type ZapLogger ¶ added in v1.4.0
type ZapLogger struct { *zapapi.Logger Sugar *zapapi.SugaredLogger // contains filtered or unexported fields }
func GetZapLogger ¶ added in v1.4.0
func GetZapLogger() *ZapLogger
func (ZapLogger) IsDebugEnabled ¶ added in v1.4.0
func (ZapLogger) IsLevelEnabled ¶ added in v1.20.1
func (ZapLogger) IsTraceEnabled ¶ added in v1.4.0
func (ZapLogger) SetLogLevel ¶ added in v1.4.0
func (ZapLogger) SetMinLogLevel ¶ added in v1.20.1
func (ZapLogger) WithEncoder ¶ added in v1.20.1
func (ZapLogger) WithSkipReportLevel ¶ added in v1.21.0
func (ZapLogger) WithValues ¶ added in v1.4.2
func (ZapLogger) WithoutName ¶ added in v1.21.0
Click to show internal directories.
Click to hide internal directories.