plugeth/internal/debug
Martin Holst Swende 58ae1df684
cmd/geth: test for logging-output (#28373)
This PR is a bit in preparation for the slog work in #28187 .

Our current test re logging mostly test the internals, but we have no real end-to-end test of the logging output. This PR introduces a simple reexec-based log tester. This also relies upon a special mode in geth, which can be made to eject a set of predefined log messages (only available if the build-tag `integrationtests` is used

e.g. go run --tags=integrationtests ./cmd/geth --log.format terminal logtest

While working on this, I also noticed a quirk in the setup: when geth was configured to use a file output, then two separate handlers were used (one handler for the file, one handler for the console). Using two separate handlers means that two formatters are used, thus the formatting of any/all records happened twice. This PR changes the mechanism to use two separate io.Writers instead, which is both more optimal and fixes a bug which occurs due to a global statefulness in the formatter.
2023-10-25 17:57:12 +02:00
..
api.go all: replace strings.Replace with string.ReplaceAll (#24835) 2022-05-09 13:13:23 +03:00
flags.go cmd/geth: test for logging-output (#28373) 2023-10-25 17:57:12 +02:00
loudpanic.go internal, log: remove code for old unsupported go-versions (#28090) 2023-09-13 01:42:32 -04:00
trace.go internal, log: remove code for old unsupported go-versions (#28090) 2023-09-13 01:42:32 -04:00