Documentation ¶
Index ¶
- Constants
- Variables
- func EncoderType() string
- func GetEncoderConfig() zapcore.EncoderConfig
- func IsDevelopment() bool
- type LogLevel
- type Logger
- type ZapLogger
- func (l *ZapLogger) Any(key string, value interface{}) Logger
- func (l *ZapLogger) Bool(key string, value bool) Logger
- func (l *ZapLogger) Debug(msg string)
- func (l *ZapLogger) Debugf(msg string, args ...interface{})
- func (l *ZapLogger) Error(msg string)
- func (l *ZapLogger) Errorf(msg string, args ...interface{})
- func (l *ZapLogger) Fatal(msg string)
- func (l *ZapLogger) Fatalf(msg string, args ...interface{})
- func (l *ZapLogger) GetLogLevel() string
- func (l *ZapLogger) HandleError(err error)
- func (l *ZapLogger) Hook(hookFunc func(level string, msg string)) Logger
- func (l *ZapLogger) Info(msg string)
- func (l *ZapLogger) Infof(msg string, args ...interface{})
- func (l *ZapLogger) Int(key string, value int) Logger
- func (ZapLogger) SetLogLevel(level string)
- func (l *ZapLogger) Str(key string, value string) Logger
- func (l *ZapLogger) Trace(msg string)
- func (l *ZapLogger) Tracef(msg string, args ...interface{})
- func (l *ZapLogger) Warn(msg string)
- func (l *ZapLogger) Warnf(msg string, args ...interface{})
- func (l *ZapLogger) With(key string, value interface{}) Logger
- func (l *ZapLogger) WithBool(key string, value bool) Logger
- func (l *ZapLogger) WithInt(key string, value int) Logger
- func (l *ZapLogger) WithStr(key string, value string) Logger
- type ZeroLogger
- func (z *ZeroLogger) Any(key string, value interface{}) Logger
- func (z *ZeroLogger) Bool(key string, value bool) Logger
- func (z *ZeroLogger) Debug(msg string)
- func (z *ZeroLogger) Debugf(msg string, args ...interface{})
- func (z *ZeroLogger) Error(msg string)
- func (z *ZeroLogger) Errorf(msg string, args ...interface{})
- func (z *ZeroLogger) Fatal(msg string)
- func (z *ZeroLogger) Fatalf(msg string, args ...interface{})
- func (z *ZeroLogger) GetLogLevel() string
- func (z *ZeroLogger) HandleError(err error)
- func (z *ZeroLogger) Hook(hookFunc func(level string, msg string)) Logger
- func (z *ZeroLogger) Info(msg string)
- func (z *ZeroLogger) Infof(msg string, args ...interface{})
- func (z *ZeroLogger) Int(key string, value int) Logger
- func (z *ZeroLogger) SetLogLevel(level string)
- func (z *ZeroLogger) Str(key string, value string) Logger
- func (z *ZeroLogger) Trace(msg string)
- func (z *ZeroLogger) Tracef(msg string, args ...interface{})
- func (z *ZeroLogger) Warn(msg string)
- func (z *ZeroLogger) Warnf(msg string, args ...interface{})
- func (z *ZeroLogger) With(key string, value interface{}) Logger
- func (z *ZeroLogger) WithBool(key string, value bool) Logger
- func (z *ZeroLogger) WithInt(key string, value int) Logger
- func (z *ZeroLogger) WithStr(key string, value string) Logger
Constants ¶
View Source
const ( // Standard keys for structured logging. TimestampKey = "ts" LevelKey = "level" ErrorKey = "error" MessageKey = "msg" EventType = "eventType" ChildEventIDKey = "childEventId" EventIDKey = "eventId" EventStatusKey = "status" TimeTakenMSKey = "timeTakenMS" WaitTimeMSKey = "waitTimeMS" QueueTimeMSKey = "queueTimeMS" QueueLengthKey = "queueLen" NameKey = "name" OperationKey = "op" TypeKey = "type" DeleteValue = "delete" CreateValue = "create" UpdateValue = "update" EnvKey = "env" RevisionKey = "revision" ControllerNameKey = "controller" ResourceIdentifierKey = "obj" WorkloadIdentifierKey = "identity" NamespaceKey = "namespace" LabelsKey = "labels" LabelSelectorKey = "labelSelector" ClusterKey = "cluster" NamespaceSecretKey = "namespace/secret" FilterNameKey = "filterName" FilterTypeKey = "filterType" HandlerNameKey = "handlerName" DependentIdentityKey = "dependentIdentity" DependentsKey = "dependents" SourceAssetKey = "sourceAsset" DestinationAssetKey = "destinationAsset" DeployNameKey = "deployName" RolloutNameKey = "rolloutName" RouteNameKey = "routeName" )
Variables ¶
View Source
var Log = NewLogger()
Log is a global logger for global context logging.
Functions ¶
func EncoderType ¶
func EncoderType() string
func GetEncoderConfig ¶
func GetEncoderConfig() zapcore.EncoderConfig
func IsDevelopment ¶
func IsDevelopment() bool
Types ¶
type Logger ¶
type Logger interface { Trace(msg string) Tracef(msg string, args ...interface{}) Debug(msg string) Debugf(msg string, args ...interface{}) Info(msg string) Infof(msg string, args ...interface{}) Warn(msg string) Warnf(msg string, args ...interface{}) Error(msg string) Errorf(msg string, args ...interface{}) Fatal(msg string) Fatalf(msg string, args ...interface{}) Str(key string, value string) Logger Int(key string, value int) Logger Any(key string, value interface{}) Logger Bool(key string, value bool) Logger WithStr(key string, value string) Logger WithBool(key string, value bool) Logger WithInt(key string, value int) Logger With(key string, value interface{}) Logger // SetLogLevel sets the log level for the logger at global level SetLogLevel(level string) GetLogLevel() string Hook(hook func(level string, msg string)) Logger // Error Handler HandleError(err error) }
func NewZapLogger ¶
func NewZapLogger() Logger
func NewZeroLogger ¶
func NewZeroLogger() Logger
type ZapLogger ¶
type ZapLogger struct {
// contains filtered or unexported fields
}
func (*ZapLogger) GetLogLevel ¶
func (*ZapLogger) HandleError ¶
func (ZapLogger) SetLogLevel ¶
type ZeroLogger ¶
type ZeroLogger struct {
// contains filtered or unexported fields
}
func (*ZeroLogger) Any ¶
func (z *ZeroLogger) Any(key string, value interface{}) Logger
func (*ZeroLogger) Debug ¶
func (z *ZeroLogger) Debug(msg string)
func (*ZeroLogger) Debugf ¶
func (z *ZeroLogger) Debugf(msg string, args ...interface{})
func (*ZeroLogger) Error ¶
func (z *ZeroLogger) Error(msg string)
func (*ZeroLogger) Errorf ¶
func (z *ZeroLogger) Errorf(msg string, args ...interface{})
func (*ZeroLogger) Fatal ¶
func (z *ZeroLogger) Fatal(msg string)
func (*ZeroLogger) Fatalf ¶
func (z *ZeroLogger) Fatalf(msg string, args ...interface{})
func (*ZeroLogger) GetLogLevel ¶
func (z *ZeroLogger) GetLogLevel() string
func (*ZeroLogger) HandleError ¶
func (z *ZeroLogger) HandleError(err error)
func (*ZeroLogger) Info ¶
func (z *ZeroLogger) Info(msg string)
func (*ZeroLogger) Infof ¶
func (z *ZeroLogger) Infof(msg string, args ...interface{})
func (*ZeroLogger) SetLogLevel ¶
func (z *ZeroLogger) SetLogLevel(level string)
func (*ZeroLogger) Trace ¶
func (z *ZeroLogger) Trace(msg string)
func (*ZeroLogger) Tracef ¶
func (z *ZeroLogger) Tracef(msg string, args ...interface{})
func (*ZeroLogger) Warn ¶
func (z *ZeroLogger) Warn(msg string)
func (*ZeroLogger) Warnf ¶
func (z *ZeroLogger) Warnf(msg string, args ...interface{})
func (*ZeroLogger) With ¶
func (z *ZeroLogger) With(key string, value interface{}) Logger
Click to show internal directories.
Click to hide internal directories.