go-ethereum/log
Jonny Rhea d07a946a5b
log: allow –vmodule to downgrade log levels (#33111)
Changes the log handler to check for vmodule level overrides
even for messages above the current level. This enables the user to selectively
hide messages from certain packages, among other things.

Also fixes a bug where handler instances created by WithAttr would not follow
the level setting anymore. The WithAttrs method is calledd by slog.Logger.With,
which we also use in go-ethereum to create context specific loggers with
pre-filled attributes. Under the previous implementation of WithAttrs, if the
application created a long-lived logger (for example, for a specific peer), then
that logger would not be affected by later level changes done on the top-level
logger, leading to potentially missed events.

Closes: #30717

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-04-16 08:53:08 +02:00
..
format.go log: remove unused parameter (#30432) 2024-10-08 13:30:07 +02:00
format_test.go log: using testing.B.Loop (#32663) 2025-09-19 17:05:21 -06:00
handler.go all: fix inconsistent receiver name and add lint rule for it (#29974) 2024-06-12 10:45:42 +03:00
handler_glog.go log: allow –vmodule to downgrade log levels (#33111) 2026-04-16 08:53:08 +02:00
logger.go log: fix some functions comments (#29907) 2024-06-17 11:03:27 +02:00
logger_test.go log: allow –vmodule to downgrade log levels (#33111) 2026-04-16 08:53:08 +02:00
root.go log: fix SetDefault for custom loggers (#31368) 2025-03-14 16:56:53 +01:00
root_test.go log: fix SetDefault for custom loggers (#31368) 2025-03-14 16:56:53 +01:00