log

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, a ...interface{})

func Error

func Error(format string, a ...interface{})

func Fatal

func Fatal(format string, a ...interface{})

func Info

func Info(format string, a ...interface{})

func InitDefaultLogger

func InitDefaultLogger()

func IsDebugLevel added in v1.2.0

func IsDebugLevel() bool

func Level added in v1.4.0

func Level() zerolog.Level

func Panic

func Panic(format string, a ...interface{})

func SetFlag added in v1.5.0

func SetFlag(f *flag.FlagSet)

func Warn

func Warn(format string, a ...interface{})

Types

type AfterErrorConfiguration added in v1.5.0

type AfterErrorConfiguration struct {
	Additions map[string]interface{} `yaml:"additions,omitempty"`
}
var (
	AfterError       spi.AfterError
	AfterErrorConfig AfterErrorConfiguration
)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(config *LoggerConfig) *Logger

func SubLogger added in v1.5.0

func SubLogger(name string) *Logger

func (*Logger) Debug

func (logger *Logger) Debug(format string, a ...interface{})

func (*Logger) Error

func (logger *Logger) Error(format string, a ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(format string, a ...interface{})

func (*Logger) GetLevel added in v1.2.0

func (logger *Logger) GetLevel() string

func (*Logger) Info

func (logger *Logger) Info(format string, a ...interface{})

func (*Logger) Panic

func (logger *Logger) Panic(format string, a ...interface{})

func (*Logger) RawJson

func (logger *Logger) RawJson(key string, raw []byte, format string, a ...interface{})

func (*Logger) Sample added in v1.5.0

func (logger *Logger) Sample(max uint32, period time.Duration) *Logger

Sample returns a logger with a sampler. max: the maximum number of events to be logged per period

func (*Logger) SubLogger added in v1.5.0

func (logger *Logger) SubLogger(name string) *Logger

func (*Logger) Warn

func (logger *Logger) Warn(format string, a ...interface{})

type LoggerConfig

type LoggerConfig struct {
	Level           string `yaml:"level,omitempty"`
	JsonFormat      bool   `yaml:"jsonFormat,omitempty"`
	EnableStdout    bool   `yaml:"enableStdout,omitempty"`
	EnableFile      bool   `yaml:"enableFile,omitempty"`
	Directory       string `yaml:"directory,omitempty"`
	Filename        string `yaml:"filename,omitempty"`
	MaxSize         int    `yaml:"maxSize,omitempty"`
	MaxBackups      int    `yaml:"maxBackups,omitempty"`
	MaxAge          int    `yaml:"maxAge,omitempty"`
	TimeFormat      string `yaml:"timeFormat,omitempty"`
	CallerSkipCount int    `yaml:"callerSkipCount,omitempty"`
	NoColor         bool   `yaml:"noColor,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL