mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 06:59:04 +00:00
testing.B.Loop() standardization and StackAsync.Debug improvement (#156)
* testing.B.Loop() standardization and StackAsync.Debug heap debugging improvement * apply @MDr164 fixes * @MDr164 great suggestions to prevent panic and print correct mallocs
This commit is contained in:
@@ -21,3 +21,9 @@ func LogAttrs(l *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr)
|
||||
l.LogAttrs(context.Background(), level, msg, attrs...)
|
||||
}
|
||||
}
|
||||
|
||||
func logAttrsAndAllocs(allocmsg string, l *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr) {
|
||||
LogAllocs(allocmsg)
|
||||
LogAttrs(l, level, msg, attrs...)
|
||||
LogAllocs(msg) // Should not log again unless LogAttrs allocated.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user