From a303e073301ffecdddea003cbae72f2f953a0ab7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 10 Nov 2022 14:37:36 +0100 Subject: Logging: Add a Debug level This makes the levels more logical --- internal/log/log.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'internal/log/log.go') diff --git a/internal/log/log.go b/internal/log/log.go index 1992a88..f8326eb 100644 --- a/internal/log/log.go +++ b/internal/log/log.go @@ -21,7 +21,9 @@ type LogLevel int8 const ( // No level set, not allowed LOG_NOTSET LogLevel = iota - // Log info, this message is not an error + // Log debug, this message is not an error but is there for debugging + LOG_DEBUG + // Log info, this message is not an error but is there for additional information LOG_INFO // Log only to provide a warning, the app still functions LOG_WARNING @@ -35,6 +37,8 @@ func (e LogLevel) String() string { switch e { case LOG_NOTSET: return "NOTSET" + case LOG_DEBUG: + return "DEBUG" case LOG_INFO: return "INFO" case LOG_WARNING: @@ -86,6 +90,10 @@ func (logger *FileLogger) Inherit(label string, err error) { } } +func (logger *FileLogger) Debug(msg string) { + logger.log(LOG_DEBUG, msg) +} + func (logger *FileLogger) Info(msg string) { logger.log(LOG_INFO, msg) } -- cgit v1.2.3