Documentation ¶
Overview ¶
Package jsonlog implements json format logging.
Index ¶
- Variables
- type Level
- type Logger
- func (l *Logger) PrintDebug(message string, properties map[string]string)
- func (l *Logger) PrintError(err error, properties map[string]string)
- func (l *Logger) PrintFatal(err error, properties map[string]string)
- func (l *Logger) PrintInfo(message string, properties map[string]string)
- func (l *Logger) Write(message []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownLogLevel = errors.New("unknown log level")
)
Functions ¶
This section is empty.
Types ¶
type Level ¶
type Level int8
Level represents the severity level for a log entry.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is custom logger type. It holds the output destination that the log entries will be written to, the minimum severity level that log entries will be written for, plus a mutex for coordinating the writes.
func New ¶
New returns a new Logger instance which writes log entries at or above a minimum severity level to a specific output destination.
func (*Logger) PrintDebug ¶
PrintDebug is a helper method to write DEBUG level log entries.
func (*Logger) PrintError ¶
PrintError is a helper method to write ERROR level log entries.
func (*Logger) PrintFatal ¶
PrintFatal is a helper method to write FATAL level log entries.
Click to show internal directories.
Click to hide internal directories.