Documentation ¶
Overview ¶
Package dlog provides basic logging functions.
It is not intended to be a fully featured or fully optimized logger-- it is just enough of a logger for oak's needs. A program utilizing oak, if it wants more powerful logs, should log to a more powerful tool, and if desired, tell oak to as well via setting dlog.DefaultLogger.
Index ¶
Constants ¶
const ( WindowClosed logCode = iota SceneStarting SceneLooping SceneEnding UnknownScene )
Constant log string identifiers. All log strings output by oak should be enumerated here.
Variables ¶
var DefaultLogger = NewLogger()
DefaultLogger is the Logger which all oak log messages are passed through.
Functions ¶
func ErrorCheck ¶
ErrorCheck checks that the input is not nil, then calls Error on it if it is not. Otherwise it does nothing. Emits the input error as is for additional processing if desired.
func Info ¶
func Info(vs ...interface{})
Info will write a log if the debug level is higher than ERROR
func SetFilter ¶
SetFilter defines a custom filter function. Log lines that return false when passed to this function will not be output.
func SetLogLevel ¶
SetLogLevel sets the log level of the default logger.
Types ¶
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