logging: linter fixes

This commit is contained in:
2025-11-15 21:02:19 -08:00
parent 9fb93a3802
commit 840066004a
7 changed files with 138 additions and 123 deletions

View File

@@ -32,31 +32,6 @@ const (
// DefaultLevel is the default logging level when none is provided.
const DefaultLevel = LevelInfo
// Cheap integer to fixed-width decimal ASCII. Give a negative width
// to avoid zero-padding. (From log/log.go in the standard library).
func itoa(i int, wid int) string {
// Assemble decimal in reverse order.
var b [20]byte
bp := len(b) - 1
for i >= 10 || wid > 1 {
wid--
q := i / 10
b[bp] = byte('0' + i - q*10)
bp--
i = q
}
// i < 10
b[bp] = byte('0' + i)
return string(b[bp:])
}
func writeToOut(level Level) bool {
if level < LevelWarning {
return true
}
return false
}
var levelPrefix = [...]string{
LevelDebug: "DEBUG",
LevelInfo: "INFO",