logger

package
v1.72.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelTrace = "TRACE"
	LevelDebug = "DEBUG"
	LevelInfo  = "INFO"
	LevelWarn  = "WARN"
	LevelError = "ERROR"
	LevelPanic = "PANIC"
	LevelFatal = "FATAL"
)

Variables

This section is empty.

Functions

func New

func New(conf Config) (zerolog.Logger, error)

Types

type Config

type Config struct {
	Level  string `desc:"TRACE, DEBUG, INFO, WARN, ERROR, PANIC, FATAL"`
	Stdout bool   `desc:"enable output to stdout"`

	Name   string `desc:"Name for file. Destination file name: <name>.log"`
	Folder string `desc:"folder for log files"`

	MaxSizeMB  int  `desc:"max size of active log file in MB"`
	MaxAgeDays int  `desc:"max age days of backups files"`
	MaxBackups int  `desc:"max backups count"`
	Compress   bool `desc:"compress backups files"`
	// contains filtered or unexported fields
}

Config for zerolog logger

func (*Config) Validate added in v1.72.7

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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