Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Header is the print format for log. It is used // to include/exclude the fields in json output. Header = `{"time":"${time_rfc3339}","level":"${level}"}` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { // Level is the log level for logging data. Level LevelType // Output is the log writer such as Stdout, Buffer, File etc. Output io.Writer // Color is to enable/disable output in colored mode. Color bool }
Configuration is the config info for initializing new logger.
type LevelType ¶
type LevelType uint8
LevelType is the log level type.
const ( // LevelTypeDebug is representing 'Debug' value for log level type. LevelTypeDebug LevelType = iota // LevelTypeInfo is representing 'Info' value for log level type. LevelTypeInfo // LevelTypeWarn is representing 'Warn' value for log level type. LevelTypeWarn // LevelTypeError is representing 'Error' value for log level type. LevelTypeError )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the logger struct.
func (*Logger) Debug ¶
Debug writes the logs on the configured output. If the log level is higher than DEBUG, log writing is ignored.
func (*Logger) Error ¶
Error writes the logs on the configured output. If the log level is higher than ERROR, log writing is ignored.
func (*Logger) Fatal ¶
Fatal writes the logs on the configured output and exits the process with 0 error code.
Click to show internal directories.
Click to hide internal directories.