continue adding Handler logic; remove unused TxQueue tests

This commit is contained in:
soypat
2025-02-09 23:43:30 -03:00
parent aa8da93f6b
commit 64a7102064
9 changed files with 520 additions and 132 deletions
+4
View File
@@ -21,6 +21,10 @@ var (
timebuf [len(timefmt) * 2]byte
)
func LogEnabled(l *slog.Logger, lvl slog.Level) bool {
return true
}
func LogAttrs(_ *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr) {
now := time.Now()
n := len(now.AppendFormat(timebuf[:0], timefmt))
+4
View File
@@ -9,6 +9,10 @@ import (
const HeapAllocDebugging = false
func LogEnabled(l *slog.Logger, lvl slog.Level) bool {
return l != nil && l.Handler().Enabled(context.Background(), lvl)
}
// LogAttrs is a helper function that is used by all package loggers and that
// can be switched out with the `debugheaplog` build tag for a non-allocating
// logger that prints out when heap allocations occur.