Skip to content

Latest commit

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GoLog

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)

Info

  • Log functions will format string with args such as fmt.Printf in every case except below
  • If the last argument to a log function is of type log.Params (map[string]any) the output will format log.Params and append it to the log message, see example below
log.Debug("Hello, %s", "World", log.Params{"time": "3pm", "afternoon": true}).Msg()

example_1

About

Simplistic golang log package.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages