diff --git a/server/src/log/log.go b/server/src/log/log.go index 9594cb1..59c10ef 100644 --- a/server/src/log/log.go +++ b/server/src/log/log.go @@ -15,12 +15,16 @@ func SetLoglevel(_loglevel int) { loglevel = _loglevel } +func logWithPrefix(message string) { + fmt.Printf("knowyt: %s", message) +} + func Debug(format string, v ...any) { lock.Lock() defer lock.Unlock() if loglevel >= LOG_DEBUG { - fmt.Printf(format, v...) + logWithPrefix(fmt.Sprintf(format, v...)) } } @@ -29,7 +33,7 @@ func Info(format string, v ...any) { defer lock.Unlock() if loglevel >= LOG_INFO { - fmt.Printf(format, v...) + logWithPrefix(fmt.Sprintf(format, v...)) } } @@ -38,7 +42,7 @@ func Warn(format string, v ...any) { defer lock.Unlock() if loglevel >= LOG_WARN { - fmt.Printf(format, v...) + logWithPrefix(fmt.Sprintf(format, v...)) } } @@ -47,7 +51,7 @@ func Error(format string, v ...any) { defer lock.Unlock() if loglevel >= LOG_ERROR { - fmt.Printf(format, v...) + logWithPrefix(fmt.Sprintf(format, v...)) } }