Write all logging (INFO, WARN, ERROR) to stderr

The old setup tried to log >= warning to stderr, the rest to stdout.

However, that logic was flawed, so warnings ended up in stdout, which makes `hugo list all` etc. hard to reason about from scripts.

This commit fixes this by making all logging (info, warn, error) log to stderr and let stdout be reserved for program output.

Fixes #13074
This commit is contained in:
Bjørn Erik Pedersen
2024-12-13 09:23:09 +01:00
committed by GitHub
parent ec1933f79d
commit 9dfa112617
15 changed files with 85 additions and 59 deletions

8
deps/deps.go vendored
View File

@@ -405,9 +405,11 @@ type DepsCfg struct {
// The logging level to use.
LogLevel logg.Level
// Where to write the logs.
// Currently we typically write everything to stdout.
LogOut io.Writer
// Logging output.
StdErr io.Writer
// The console output.
StdOut io.Writer
// The file systems to use
Fs *hugofs.Fs