Documentation ¶
Index ¶
- Constants
- Variables
- func DiscardLogging()
- func LogCountForLevel(l Level) uint64
- func LogCountForLevelsGreaterThanorEqualTo(threshold Level) uint64
- func ResetLogCounters()
- func SetLogFile(path string)
- func SetLogFlag(flags int)
- func SetLogThreshold(level Level)
- func SetStdoutThreshold(level Level)
- func UseTempLogFile(prefix string)
- type Feedback
- type Level
- type NotePad
Constants ¶
const ( DATE = log.Ldate TIME = log.Ltime SFILE = log.Lshortfile LFILE = log.Llongfile MSEC = log.Lmicroseconds )
Variables ¶
var ( TRACE *log.Logger DEBUG *log.Logger INFO *log.Logger WARN *log.Logger ERROR *log.Logger CRITICAL *log.Logger FATAL *log.Logger LOG *log.Logger FEEDBACK Feedback LogHandle io.Writer = ioutil.Discard OutHandle io.Writer = os.Stdout BothHandle io.Writer = io.MultiWriter(LogHandle, OutHandle) NotePads []*NotePad = []*NotePad{trace, debug, info, warn, err, critical, fatal} )
Functions ¶
func LogCountForLevel ¶
LogCountForLevel returns the number of log invocations for a given level.
func LogCountForLevelsGreaterThanorEqualTo ¶
LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations greater than or equal to a given level threshold.
func ResetLogCounters ¶
func ResetLogCounters()
ResetLogCounters resets the invocation counters for all levels.
func SetLogFile ¶
func SetLogFile(path string)
Conveniently Sets the Log Handle to a io.writer created for the file behind the given filepath Will only append to this file
func SetLogFlag ¶
func SetLogFlag(flags int)
Set the log Flags (Available flag: DATE, TIME, SFILE, LFILE and MSEC)
func SetLogThreshold ¶
func SetLogThreshold(level Level)
Establishes a threshold where anything matching or above will be logged
func SetStdoutThreshold ¶
func SetStdoutThreshold(level Level)
Establishes a threshold where anything matching or above will be output
func UseTempLogFile ¶
func UseTempLogFile(prefix string)
Conveniently Creates a temporary file and sets the Log Handle to a io.writer created for it
Types ¶
type Feedback ¶
type Feedback struct{}
Feedback is special. It writes plainly to the output while logging with the standard extra information (date, file, etc) Only Println and Printf are currently provided for this
type Level ¶
type Level int
Level describes the chosen log level between debug and critical.
const ( LevelTrace Level = iota LevelDebug LevelInfo LevelWarn LevelError LevelCritical LevelFatal DefaultLogThreshold = LevelWarn DefaultStdoutThreshold = LevelError )
func StdoutThreshold ¶
func StdoutThreshold() Level
Level returns the current global output threshold.