corelog

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Disabled zerolog.Logger

	DefaultLevel   = zerolog.InfoLevel
	DefaultLogFile = "jaxnetd.log"
)

Functions

func New

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

Types

type Config

type Config struct {
	// Disable console logging
	DisableConsoleLog bool `yaml:"disable_console_log" toml:"disable_console_log"`
	// LogsAsJSON makes the log framework log JSON
	LogsAsJSON bool `yaml:"logs_as_json" toml:"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" toml:"file_logging_enabled"`
	// Directory to log to to when filelogging is enabled
	Directory string `yaml:"directory" toml:"directory"`
	// Filename is the name of the logfile which will be placed inside the directory
	Filename string `yaml:"filename" toml:"filename"`
	// MaxSize the max size in MB of the logfile before it's rolled
	MaxSize int `yaml:"max_size" toml:"max_size"`
	// MaxBackups the max number of rolled files to keep
	MaxBackups int `yaml:"max_backups" toml:"max_backups"`
	// MaxAge the max age in days to keep a logfile
	MaxAge  int  `yaml:"max_age" toml:"max_age"`
	NoColor bool `yaml:"no_color" toml:"no_color"`
}

Config for logging

func (Config) Default

func (Config) Default() Config

type Logger

type Logger struct {
	*zerolog.Logger
}

Jump to

Keyboard shortcuts

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