Logrus hooks for terminal vs log-file output (#16102)

## Review after #16059 

**What type of PR is this?**
Feature

**What does this PR do?**
This PR introduces logrus writer hooks into the logging of prysm.
when log-format is text:
- set the default logrus output to be `io.Discard`
- create a writer hook for terminal, with formatting and coloring
enabled.
- create a separate writer hook for log-file (if enabled), without
coloring.

This immediately allows for having formatted/colored terminal logs,
while keeping the log-file clean.
This commit is contained in:
Bastin
2026-01-05 16:20:12 +01:00
committed by GitHub
parent 6b5ba5ad01
commit 6fa0e9cf5f
9 changed files with 86 additions and 17 deletions

View File

@@ -0,0 +1,4 @@
### Added
- Added separate logrus hooks for handling the formatting and output of terminal logs vs log-file logs, instead of the
default logrus output.