Documentation ¶
Overview ¶
Package jsonlog implements json format logging.
Index ¶
- type JSONLog
- func (l *JSONLog) PrintDebug(message string, properties map[string]string)
- func (l *JSONLog) PrintError(err error, properties map[string]string)
- func (l *JSONLog) PrintFatal(err error, properties map[string]string)
- func (l *JSONLog) PrintInfo(message string, properties map[string]string)
- func (l *JSONLog) PrintWarning(message string, properties map[string]string)
- func (l *JSONLog) Write(message []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONLog ¶
type JSONLog struct {
// contains filtered or unexported fields
}
JSONLog 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 JSONLog instance which writes log entries at or above a minimum severity level to a specific output destination.
func (*JSONLog) PrintDebug ¶
PrintDebug is a helper method to write DEBUG level log entries.
func (*JSONLog) PrintError ¶
PrintError is a helper method to write ERROR level log entries.
func (*JSONLog) PrintFatal ¶
PrintFatal is a helper method to write FATAL level log entries.
func (*JSONLog) PrintWarning ¶ added in v2.4.0
PrintWarning is a helper method to write WARNING level log entries.