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.Stdoutos.Filebytes.BufferAny type that implements the io.Writer interface
Loglevel plog.LogLevel plog.Noneplog.FatalLevelplog.ErrorLevelplog.WarnLevelplog.InfoLevelplog.DebugLevelplog.TraceLevel
LogFormat plog.LogFormat plog.TextFormatplog.JSONFormatplog.CSVFormat
TimestampFormat string time.RFC3339"Mon Jan 2 15:04:05 -0700 MST 2006"See time.Format() docs for more information
ColorLogging bool falsetrue when LogLevel set to plog.TextFormat