mirror of
https://github.com/soypat/lneto.git
synced 2026-08-15 12:23:44 +00:00
continue adding Handler logic; remove unused TxQueue tests
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user