corelog

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Disabled zerolog.Logger

	DefaultLevel   = zerolog.InfoLevel
	DefaultLogFile = "shard.core.log"
)

Functions

func New

func New(unit string, logLevel zerolog.Level, config Config) zerolog.Logger

Types

type Config added in v0.1.6

type Config struct {
	// Disable console logging
	DisableConsoleLog bool `yaml:"disable_console_log"`
	// LogsAsJson makes the log framework log JSON
	LogsAsJson bool `yaml:"logs_as_json"`
	// FileLoggingEnabled makes the framework log to a file
	// the fields below can be skipped if this value is false!
	FileLoggingEnabled bool `yaml:"file_logging_enabled"`
	// Directory to log to to when filelogging is enabled
	Directory string `yaml:"directory"`
	// Filename is the name of the logfile which will be placed inside the directory
	Filename string `yaml:"filename"`
	// MaxSize the max size in MB of the logfile before it's rolled
	MaxSize int `yaml:"max_size"`
	// MaxBackups the max number of rolled files to keep
	MaxBackups int `yaml:"max_backups"`
	// MaxAge the max age in days to keep a logfile
	MaxAge int `yaml:"max_age"`
}

Configuration for logging

func (Config) Default added in v0.1.6

func (Config) Default() Config

type Logger added in v0.1.6

type Logger struct {
	*zerolog.Logger
}

Jump to

Keyboard shortcuts

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