Missing log Output() error handling 47/9147/1
authorTimo Tietavainen <timo.tietavainen@nokia.com>
Fri, 30 Sep 2022 10:20:01 +0000 (13:20 +0300)
committerTimo Tietavainen <timo.tietavainen@nokia.com>
Fri, 30 Sep 2022 10:20:01 +0000 (13:20 +0300)
Replace log package Output() function usage with Printf() function,
which do not return error status and hence suites better for SDL logger
module use case.

Issue-Id: RIC-942

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: I0f0e0e654d87f8da3f074e52a0ae25fef8d76159

internal/sdlgoredis/logger.go

index 1595a2e..a1b4a5c 100644 (file)
@@ -23,7 +23,6 @@ package sdlgoredis
 
 import (
        "context"
-       "fmt"
        "log"
 )
 
@@ -32,5 +31,5 @@ type logger struct {
 }
 
 func (dbLog *logger) Printf(ctx context.Context, format string, v ...interface{}) {
-       dbLog.log.Output(2, fmt.Sprintf(format, v...))
+       dbLog.log.Printf(format, v...)
 }