Files
HackBrowserData/internal/log/log.go
T
Roger 2c3ac7f1d2 refactor: drop single-use abstractions, loosen varnamelen (#680)
log.Base had one implementation, the chromium file specs took a dir they never read, and emit was written three times;
varnamelen now lets db, fd, and n stay short as Go readers expect.
2026-11-02 11:19:53 +08:00

25 lines
461 B
Go

package log
import (
"fmt"
"os"
)
var defaultLogger = newLogger(os.Stderr)
func SetVerbose() {
defaultLogger.SetLevel(DebugLevel)
}
func Debugf(format string, args ...any) {
defaultLogger.logMsg(DebugLevel, fmt.Sprintf(format, args...))
}
func Infof(format string, args ...any) {
defaultLogger.logMsg(InfoLevel, fmt.Sprintf(format, args...))
}
func Warnf(format string, args ...any) {
defaultLogger.logMsg(WarnLevel, fmt.Sprintf(format, args...))
}