Simplistic golang log package.
Functions
funcSetLevel(lvlLevel)
funcSetPath(pstring) // set path to log dir for logging to filefuncEnableLogToFile()
funcDisableLogToFile()
funcEnableLogToMsg()
funcDisableLogToMsg()
funcDebug(formatstring, args...any) LogfuncInfo(formatstring, args...any) LogfuncWarn(formatstring, args...any) LogfuncError(formatstring, args...any) LogfuncFatal(formatstring, args...any) Logfunc (lLog) Msg() // log to stdout/stderrfunc (lLog) File() // log to filefunc (lLog) Full() // log to stdout/stderr then file (if allowed)- Log functions will format string with args such as
fmt.Printfin every case except below - If the last argument to a log function is of type
log.Params (map[string]any)the output will formatlog.Paramsand append it to the log message, see example below
log.Debug("Hello, %s", "World", log.Params{"time": "3pm", "afternoon": true}).Msg()