update comments

This commit is contained in:
BabyHalimao 2024-06-04 10:54:21 +08:00
parent d75fe2d0a6
commit 1896d43489

View file

@ -168,8 +168,9 @@ func (h *GlogHandler) WithGroup(name string) slog.Handler {
panic("not implemented") panic("not implemented")
} }
// Handle implements slog.Handler.Handle, filtering a log record through the global, local // Handle implements slog.Handler.Handle
// and backtrace filters, finally emitting it if either allows it through. // If the global log level allows, fast track logging.
// Else use the calculated log level to track logging or drop it.
func (h *GlogHandler) Handle(_ context.Context, r slog.Record) error { func (h *GlogHandler) Handle(_ context.Context, r slog.Record) error {
// If the global log level allows, fast track logging // If the global log level allows, fast track logging
if slog.Level(h.level.Load()) <= r.Level { if slog.Level(h.level.Load()) <= r.Level {