My personal take on a logging libary, primarily made for ResponsePlan, inspired by Distillog.
- Adjustable log output
- Toggle every log level on and off
- Adjustable colors
- Adjustable template using text/template
- Default logger
The log output can be adjusted using the SetOutput
function.
Any os.File
can be used as an output.
Every log level can be toggled on and off using the Toggle
function.
The colors used for the log levels can be adjusted using the SetColor
function.
The template used to format the log messages is fully adjustable using
text/template
. The following variables are available:
{{ .Time }}
- The time the log message was created{{ .Level }}
- The log level of the message{{ .Message }}
- The message itself{{ .Color }}
- The color of the log level{{ .Reset }}
- The reset code to reset the color
A default logger is provided, which can be used to log messages without creating a new logger. The default logger can be accessed at package level.