Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// Embedded logger, the functionality of which will be extended.
*log.Logger
// contains filtered or unexported fields
}
Logger represents an active logging object. Decorator https://pkg.go.dev/log#Logger . A Logger can be used simultaneously from multiple goroutines; it guaranteesto serialize access to the Writer.
func NewCustomLogger ¶
NewCustomLogger creates a new logger object with custom `writer`, `prefix` and `flags`. Rotation does not work in this case. Such logger is widely used in tests.
func (*Logger) GetOpts ¶
func (logger *Logger) GetOpts() *LoggerOpts
GetOpts returns the parameters that were used to create the logger.
type LoggerOpts ¶
type LoggerOpts struct {
// Filename is the name of log file.
Filename string
// MaxSize is the maximum size in megabytes of the log file
// before it gets rotated.
MaxSize int
// MaxBackups is the maximum number of old log files to retain.
MaxBackups int
// MaxAge is the maximum number of days to retain old log files
// based on the timestamp encoded in their filename.
MaxAge int
}
LoggerOpts describes the logger options.
Click to show internal directories.
Click to hide internal directories.