Documentation
¶
Index ¶
Constants ¶
View Source
const ( TimeFormat = "15:04:05.000" // ConsoleFormatFull shows a console record as its time, its level and // its message. ConsoleFormatFull = "full" // ConsoleFormatPlain shows a console record as its message alone, as // the lines a command prints, with its level before it from the // warnings up, for a command whose output tells a story its records // are lines of. ConsoleFormatPlain = "plain" )
Logger is the opensvc specific zerolog logger
Variables ¶
View Source
var ( // WithCaller adds the file:line information of the logger caller WithCaller bool )
Functions ¶
func DropFields ¶
DropFields is the FormatPrepare of a console writer showing an entry as its time, its level, its message and its error: it removes the other fields, which the writer separates by a space each, even when it renders them as nothing, padding the line with as many trailing blanks.
func FormatLevel ¶
func FormatLevel(i interface{}) string
func FormatPlainLevel ¶
func FormatPlainLevel(i interface{}) string
FormatPlainLevel is the level of a record in the plain console format: none below the warnings, which read as the lines a command prints.
Types ¶
type Config ¶
type Config struct {
// WithCaller includes the caller file:line to the records
WithCaller bool
// Enable console logging
WithConsoleLog bool
// Enable console logging coloring
WithColor bool
// ConsoleFormat is the format of the console records:
// ConsoleFormatFull, the default, or ConsoleFormatPlain.
ConsoleFormat string
WithJournald bool
WithSyslogd bool
// LogFile makes the framework log to a file
LogFile string
// SessionLogFile logs to a per-sessionid file
SessionLogFile string
// Level is the minimum log record level to accept.
// debug, info, warn[ing], error, fatal, panic
Level string
// MaxSize the max size in MB of the logfile before it's rolled
MaxSize int
// MaxBackups the max number of rolled files to keep
MaxBackups int
// MaxAge the max age in days to keep a logfile
MaxAge int
}
Config is the configuration of the zerolog logger and writers
Click to show internal directories.
Click to hide internal directories.