Documentation ¶
Index ¶
- Constants
- func BindFlags(flags *pflag.FlagSet)
- 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 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 (zap ZapLogger) WithValues(keysAndValues ...interface{}) Logger
Constants ¶
View Source
const ( Cyan = cyan + Normal Magenta = magenta + Normal Normal = "m" Reset = "\x1b[0m" )
View Source
const TraceLevel = zapcore.DebugLevel - 1
Variables ¶
This section is empty.
Functions ¶
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 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 }
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) WithValues ¶ added in v1.4.2
Click to show internal directories.
Click to hide internal directories.