Documentation ¶
Overview ¶
Package logging provides a dead-simple, level-aware logging facility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(format string, v ...interface{})
Debug logs the given message with DEBUG level.
func Error ¶
func Error(format string, v ...interface{})
Error logs the given message with ERROR level.
Types ¶
type Level ¶
type Level uint8
Level defines all available log levels.
func LevelFromString ¶
LevelFromString parses a string and returns the approriate Level with the same name. If no such Level exists, a non-nil error is returned.
type Logger ¶
type Logger interface { Debug(format string, v ...interface{}) Info(format string, v ...interface{}) Warn(format string, v ...interface{}) Error(format string, v ...interface{}) Fatal(format string, v ...interface{}) }
A Logger is used to write a string to some output using a certain log level that is part of the written string.
func NewDefaultLevelLogger ¶
NewDefaultLevelLogger creates a new logging object. The log level is inherited from the default logger which is set via SetLevel. The optional prefix is prepended to each log output.
Click to show internal directories.
Click to hide internal directories.