Documentation ¶
Index ¶
- Constants
- Variables
- type BufferLogger
- type BufferLoggerPool
- type EncoderConfig
- type EncoderConfigConsole
- type EncoderConfigJSON
- type Level
- type MuxLogger
- func (ml *MuxLogger) Debug(format interface{}, vars ...interface{})
- func (ml *MuxLogger) DebugCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) DebugWith(format interface{}, vars ...interface{})
- func (ml *MuxLogger) DebugWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) Error(format interface{}, vars ...interface{})
- func (ml *MuxLogger) ErrorCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) ErrorWith(format interface{}, vars ...interface{})
- func (ml *MuxLogger) ErrorWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) Flush()
- func (ml *MuxLogger) GetChild(name string) logger.Logger
- func (ml *MuxLogger) GetLoggers() []logger.Logger
- func (ml *MuxLogger) Info(format interface{}, vars ...interface{})
- func (ml *MuxLogger) InfoCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) InfoWith(format interface{}, vars ...interface{})
- func (ml *MuxLogger) InfoWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) SetLoggers(loggers ...logger.Logger)
- func (ml *MuxLogger) Warn(format interface{}, vars ...interface{})
- func (ml *MuxLogger) WarnCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (ml *MuxLogger) WarnWith(format interface{}, vars ...interface{})
- func (ml *MuxLogger) WarnWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- type NuclioZap
- func (nz *NuclioZap) Debug(format interface{}, vars ...interface{})
- func (nz *NuclioZap) DebugCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) DebugWith(format interface{}, vars ...interface{})
- func (nz *NuclioZap) DebugWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) Error(format interface{}, vars ...interface{})
- func (nz *NuclioZap) ErrorCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) ErrorWith(format interface{}, vars ...interface{})
- func (nz *NuclioZap) ErrorWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) Flush()
- func (nz *NuclioZap) GetChild(name string) logger.Logger
- func (nz *NuclioZap) GetLevel() Level
- func (nz *NuclioZap) GetRedactor() *Redactor
- func (nz *NuclioZap) Info(format interface{}, vars ...interface{})
- func (nz *NuclioZap) InfoCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) InfoWith(format interface{}, vars ...interface{})
- func (nz *NuclioZap) InfoWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) SetLevel(level Level)
- func (nz *NuclioZap) Warn(format interface{}, vars ...interface{})
- func (nz *NuclioZap) WarnCtx(ctx context.Context, format interface{}, vars ...interface{})
- func (nz *NuclioZap) WarnWith(format interface{}, vars ...interface{})
- func (nz *NuclioZap) WarnWithCtx(ctx context.Context, format interface{}, vars ...interface{})
- type RedactingLogger
- type Redactor
- func (r *Redactor) AddRedactions(redactions []string)
- func (r *Redactor) AddValueRedactions(valueRedactions []string)
- func (r *Redactor) Disable()
- func (r *Redactor) Enable()
- func (r *Redactor) GetOutput() io.Writer
- func (r *Redactor) GetRedactions() [][]byte
- func (r *Redactor) SetDisabled(disable bool)
- func (r *Redactor) SetOutput(output io.Writer)
- func (r *Redactor) Write(p []byte) (n int, err error)
- type VarGroupMode
Constants ¶
const DefaultVarGroupMode = VarGroupModeFlattened
Variables ¶
var ErrBufferPoolAllocationTimeout = errors.New("Timed out waiting for buffer logger")
Functions ¶
This section is empty.
Types ¶
type BufferLogger ¶
type BufferLogger struct { Logger *NuclioZap Buffer *bytes.Buffer // contains filtered or unexported fields }
BufferLogger is a logger who outputs the records to a buffer
func NewBufferLogger ¶
func NewBufferLogger(name string, encoding string, level Level) (*BufferLogger, error)
NewBufferLogger creates a logger that is able to capture the output into a buffer. if a request arrives and the user wishes to capture the log, this will be used as the logger instead of the default logger
func (*BufferLogger) GetJSONString ¶
func (bl *BufferLogger) GetJSONString() (string, error)
func (*BufferLogger) GetLogEntries ¶
func (bl *BufferLogger) GetLogEntries() ([]map[string]interface{}, error)
type BufferLoggerPool ¶
type BufferLoggerPool struct {
// contains filtered or unexported fields
}
BufferLoggerPool is a pool for buffer loggers
func NewBufferLoggerPool ¶
func (*BufferLoggerPool) Allocate ¶
func (blp *BufferLoggerPool) Allocate(timeout *time.Duration) (*BufferLogger, error)
func (*BufferLoggerPool) Release ¶
func (blp *BufferLoggerPool) Release(bufferLogger *BufferLogger)
type EncoderConfig ¶
type EncoderConfig struct { JSON EncoderConfigJSON Console EncoderConfigConsole }
func NewEncoderConfig ¶
func NewEncoderConfig() *EncoderConfig
type EncoderConfigConsole ¶
type EncoderConfigConsole struct { }
type EncoderConfigJSON ¶
type EncoderConfigJSON struct { LineEnding string VarGroupName string VarGroupMode VarGroupMode TimeFieldName string TimeFieldEncoding string ReflectedEncoder func(writer io.Writer) zapcore.ReflectedEncoder }
type Level ¶
type Level int8
Level is logging levels
const ( DebugLevel Level = Level(zapcore.DebugLevel) InfoLevel Level = Level(zapcore.InfoLevel) WarnLevel Level = Level(zapcore.WarnLevel) ErrorLevel Level = Level(zapcore.ErrorLevel) DPanicLevel Level = Level(zapcore.DPanicLevel) PanicLevel Level = Level(zapcore.PanicLevel) FatalLevel Level = Level(zapcore.FatalLevel) )
Predefined logging levels
func GetLevelByName ¶
GetLevelByName return logging level by name
type MuxLogger ¶
type MuxLogger struct {
// contains filtered or unexported fields
}
MuxLogger multiplexes logs towards multiple loggers
func (*MuxLogger) DebugWith ¶
func (ml *MuxLogger) DebugWith(format interface{}, vars ...interface{})
func (*MuxLogger) DebugWithCtx ¶
func (*MuxLogger) ErrorWith ¶
func (ml *MuxLogger) ErrorWith(format interface{}, vars ...interface{})
func (*MuxLogger) ErrorWithCtx ¶
func (*MuxLogger) GetLoggers ¶
func (*MuxLogger) InfoWithCtx ¶
func (*MuxLogger) SetLoggers ¶
func (*MuxLogger) WarnWithCtx ¶
type NuclioZap ¶
type NuclioZap struct { *zap.SugaredLogger // contains filtered or unexported fields }
NuclioZap is a concrete implementation of the nuclio logger interface, using zap
func NewNuclioZap ¶
func NewNuclioZap(name string, encoding string, customEncoderConfig *EncoderConfig, sink io.Writer, errSink io.Writer, level Level) (*NuclioZap, error)
NewNuclioZap create a configurable logger
func NewNuclioZapCmd ¶
NewNuclioZapCmd creates a logger pre-configured for commands
func NewNuclioZapTest ¶
NewNuclioZapTest creates a logger pre-configured for tests
func (*NuclioZap) Debug ¶
func (nz *NuclioZap) Debug(format interface{}, vars ...interface{})
Debug emits debug level log
func (*NuclioZap) DebugWith ¶
func (nz *NuclioZap) DebugWith(format interface{}, vars ...interface{})
DebugWith emits debug level log with arguments
func (*NuclioZap) DebugWithCtx ¶
DebugWithCtx emits debug level log with arguments
func (*NuclioZap) Error ¶
func (nz *NuclioZap) Error(format interface{}, vars ...interface{})
Errors emits error level log
func (*NuclioZap) ErrorWith ¶
func (nz *NuclioZap) ErrorWith(format interface{}, vars ...interface{})
ErrorWith emits error level log with arguments
func (*NuclioZap) ErrorWithCtx ¶
ErrorWithCtx emits debug level log with arguments
func (*NuclioZap) GetRedactor ¶
func (*NuclioZap) Info ¶
func (nz *NuclioZap) Info(format interface{}, vars ...interface{})
Info emits info level log
func (*NuclioZap) InfoWith ¶
func (nz *NuclioZap) InfoWith(format interface{}, vars ...interface{})
InfoWith emits info level log with arguments
func (*NuclioZap) InfoWithCtx ¶
InfoWithCtx emits debug level log with arguments
func (*NuclioZap) Warn ¶
func (nz *NuclioZap) Warn(format interface{}, vars ...interface{})
Warn emits warn level log
func (*NuclioZap) WarnWith ¶
func (nz *NuclioZap) WarnWith(format interface{}, vars ...interface{})
WarnWith emits warn level log with arguments
func (*NuclioZap) WarnWithCtx ¶
WarnWithCtx emits debug level log with arguments
type RedactingLogger ¶
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
func NewRedactor ¶
func (*Redactor) AddRedactions ¶
AddRedactions redacts simple strings
func (*Redactor) AddValueRedactions ¶
AddValueRedactions redacts key:[value] or key=[value] kind of strings
func (*Redactor) GetRedactions ¶
func (*Redactor) SetDisabled ¶
SetDisabled turns logger redaction on/off
type VarGroupMode ¶
type VarGroupMode string
const ( VarGroupModeFlattened VarGroupMode = "flattened" VarGroupModeStructured VarGroupMode = "structured" )