Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(msg string, keysAndValues ...interface{})
- func Error(msg string, keysAndValues ...interface{})
- func Fatal(msg string, keysAndValues ...interface{})
- func Info(msg string, keysAndValues ...interface{})
- func Init(cfg *LoggerConfig)
- func IsSetFromEnv() bool
- func SetBase(l *Logger)
- func Warn(msg string, keysAndValues ...interface{})
- type Config
- type Encoder
- type EncoderConfig
- type Level
- type LogCounter
- type LogOrigin
- type Logger
- func (l *Logger) Debug(msg string, keysAndValues ...interface{})
- func (l *Logger) Error(msg string, keysAndValues ...interface{})
- func (l *Logger) Fatal(msg string, keysAndValues ...interface{})
- func (l *Logger) Info(msg string, keysAndValues ...interface{})
- func (l *Logger) Sync() error
- func (l *Logger) Warn(msg string, keysAndValues ...interface{})
- type LoggerConfig
Constants ¶
View Source
const ( TRACEE_LOGGER_LVL = "TRACEE_LOGGER_LVL" TRACEE_LOGGER_ENCODER = "TRACEE_LOGGER_ENCODER" TRACEE_LOGGER_AGGREGATE = "TRACEE_LOGGER_AGGREGATE" )
Variables ¶
View Source
var ( NewDevelopmentConfig = zap.NewDevelopmentConfig NewProductionConfig = zap.NewProductionConfig )
View Source
var ( NewConsoleEncoder = zapcore.NewConsoleEncoder NewJSONEncoder = zapcore.NewJSONEncoder )
View Source
var ( NewDevelopmentEncoderConfig = zap.NewDevelopmentEncoderConfig NewProductionEncoderConfig = zap.NewProductionEncoderConfig )
Functions ¶
func Init ¶
func Init(cfg *LoggerConfig)
Init sets the package-level base logger using given config It's not thread safe so if required use it always at the beggining
func IsSetFromEnv ¶
func IsSetFromEnv() bool
Types ¶
type EncoderConfig ¶
type EncoderConfig = zapcore.EncoderConfig
type Level ¶
const ( DebugLevel Level = zap.DebugLevel InfoLevel Level = zap.InfoLevel WarnLevel Level = zap.WarnLevel ErrorLevel Level = zap.ErrorLevel DPanicLevel Level = zap.DPanicLevel PanicLevel Level = zap.PanicLevel FatalLevel Level = zap.FatalLevel )
type LogCounter ¶
type LogCounter struct {
// contains filtered or unexported fields
}
func (*LogCounter) Dump ¶
func (lc *LogCounter) Dump() map[LogOrigin]uint32
type Logger ¶
type Logger struct { LogCount *LogCounter // updated only on debug level and cfg.Aggregate == true // contains filtered or unexported fields }
Logger struct
type LoggerConfig ¶
func NewDefaultLoggerConfig ¶
func NewDefaultLoggerConfig() *LoggerConfig
Click to show internal directories.
Click to hide internal directories.