Documentation ¶
Overview ¶
Package dlog provides logging functions with caller file and line information, logging levels and level and text filters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CreateLogFile = func() {}
CreateLogFile creates a file for logs to be written to by log functions. This is a NOP if fullOakLogger is not set by SetLogger.
var Error = func(...interface{}) {}
Error will write a log if the debug level is not NONE
var FileWrite = func(...interface{}) {}
FileWrite logs by writing to file (if possible) but does not log to console as well. This is a NOP if fullOakLogger is not set by SetLogger.
var GetLogLevel = func() Level { return NONE }
GetLogLevel returns the log level of the fullOakLogger, or NONE if there is not fullOakLogger.
var Info = func(...interface{}) {}
Info will write a log if the debug level is higher than WARN
var SetDebugFilter = func(string) {}
SetDebugFilter defines a string that all logs should be checked against-- if the log message does not contain the input string the log will not log. This is a NOP if fullOakLogger is not set by SetLogger.
var SetDebugLevel = func(Level) {}
SetDebugLevel sets the log level of the fullOakLogger. This is a NOP if fullOakLogger is not set by SetLogger.
var Verb = func(...interface{}) {}
Verb will write a log if the debug level is higher than INFO
var Warn = func(...interface{}) {}
Warn will write a log if the debug level is higher than ERROR
Functions ¶
func ErrorCheck ¶ added in v1.4.0
func ErrorCheck(in error)
ErrorCheck checks that the input is not nil, then calls Error on it if it is not. Otherwise it does nothing.
Types ¶
type FullLogger ¶
type FullLogger interface { Logger GetLogLevel() Level FileWrite(in ...interface{}) SetDebugFilter(filter string) SetDebugLevel(dL Level) CreateLogFile() }
A FullLogger supports, in addition to Logger's functions, the ability to set and get a log level, and create and write logs directly to file.
type Level ¶
type Level int
Level represents the levels a debug message can have
func ParseDebugLevel ¶
ParseDebugLevel parses the input string as a known debug levels