fix: resolve deepsource linter issues
- Fixed the append usage warning (CRT-D0001) - Fixed the nil context warning (SCC-SA1012)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package debug
|
package debug
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
@@ -95,8 +96,11 @@ func Log(level int, msg string, args ...interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
allArgs := append(args, "debug_level", level)
|
allArgs := make([]interface{}, len(args)+2)
|
||||||
logger.Log(nil, slogLevel, msg, allArgs...)
|
copy(allArgs, args)
|
||||||
|
allArgs[len(args)] = "debug_level"
|
||||||
|
allArgs[len(args)+1] = level
|
||||||
|
logger.Log(context.TODO(), slogLevel, msg, allArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetDebugLevel(level int) {
|
func SetDebugLevel(level int) {
|
||||||
|
|||||||
Reference in New Issue
Block a user