Logger Configuration - pd93/plog GitHub Wiki
Changing a logger's configuration
Configuration options
The table below lists all the available configuration options for a logger.
Name | Type | Possible Values(default in bold) |
---|---|---|
Output |
io.Writer |
os.Stdout os.File bytes.Buffer Any type that implements the io.Writer interface |
Loglevel |
plog.LogLevel |
plog.None plog.FatalLevel plog.ErrorLevel plog.WarnLevel plog.InfoLevel plog.DebugLevel plog.TraceLevel |
LogFormat |
plog.LogFormat |
plog.TextFormat plog.JSONFormat plog.CSVFormat |
TimestampFormat |
string |
time.RFC3339 "Mon Jan 2 15:04:05 -0700 MST 2006" See time.Format() docs for more information |
ColorLogging |
bool |
false true when LogLevel set to plog.TextFormat |