Documentation ¶
Overview ¶
Package gologger provides a simple layer for leveled logging in go.
Index ¶
- type Event
- type Logger
- func (l *Logger) Debug() *Event
- func (l *Logger) Error() *Event
- func (l *Logger) Fatal() *Event
- func (l *Logger) Info() *Event
- func (l *Logger) Log(event *Event)
- func (l *Logger) Print() *Event
- func (l *Logger) SetFormatter(formatter formatter.Formatter)
- func (l *Logger) SetMaxLevel(level levels.Level)
- func (l *Logger) SetTimestamp(timestamp bool, minLevel levels.Level)
- func (l *Logger) SetWriter(writer writer.Writer)
- func (l *Logger) Verbose() *Event
- func (l *Logger) Warning() *Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶ added in v1.1.0
type Event struct {
// contains filtered or unexported fields
}
Event is a log event to be written with data
func Print ¶ added in v1.1.0
func Print() *Event
Print prints a string on stderr without any extra labels.
func Warning ¶
func Warning() *Event
Warning writes a warning message on the screen with the default label
func (*Event) MsgFunc ¶ added in v1.1.5
MsgFunc logs a message with lazy evaluation. Useful when computing the message can be resource heavy.
type Logger ¶ added in v1.1.0
type Logger struct {
// contains filtered or unexported fields
}
Logger is a logger for logging structured data in a beautfiul and fast manner.
var ( // DefaultLogger is the default logging instance DefaultLogger *Logger )
func (*Logger) Debug ¶ added in v1.1.0
Debug writes an error message on the screen with the default label
func (*Logger) Error ¶ added in v1.1.0
Error writes a error message on the screen with the default label
func (*Logger) Info ¶ added in v1.1.0
Info writes a info message on the screen with the default label
func (*Logger) SetFormatter ¶ added in v1.1.0
SetFormatter sets the formatter instance for a logger
func (*Logger) SetMaxLevel ¶ added in v1.1.0
SetMaxLevel sets the max logging level for logger
func (*Logger) SetTimestamp ¶ added in v1.1.6
SetTimestamp enables/disables automatic timestamp