logging

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level         string `comment:"Log level: trace, debug, info, warn, error, fatal, panic (default 'info')"`
	FileLogging   bool   `comment:"Enable logging to file (default true)"`
	FilePath      string `comment:"File path for file-based logging (default './smoothdb.log')"`
	MaxSize       int    `comment:"MaxSize is the maximum size in megabytes of the log file before it gets rotated."`
	MaxBackups    int    `comment:"MaxBackups is the maximum number of old log files to retain."`
	MaxAge        int    `comment:"MaxAge is the maximum number of days to retain old log files"`
	Compress      bool   `comment:"True to compress old log files (default false)"`
	StdOut        bool   `comment:"Enable logging to stdout (default false)"`
	PrettyConsole bool   `comment:"Enable pretty output for stdout (default false)"`
	ColorConsole  bool   `comment:"Enable colorful output for stdout (default false)"`
}

func DefaultConfig

func DefaultConfig() *Config

type Logger

type Logger struct {
	*zerolog.Logger
}

func InitLogger

func InitLogger(config *Config) *Logger

InitLogger initilaizes the logger

Jump to

Keyboard shortcuts

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