7. Standardize log output
· One min read
Status
Accepted
Context
- ADR 2 is not completely relevant now, we have migrated recently the logs in the client to
stderr
. Only the result of the command execution is instdout
. This makes it possible to exploit the result, see our blog post. - Mithril aggregator logs are always redirected to
stdout
but it mixes 2 types of CLI commands, some of which would benefit from the logs output tostderr
. - Mithril aggregator and Mithril client CLI have not a consistent log strategy, that's why we need to standardize them.
Decision
- For commands that provide a result or execute an action, logs are sent to
stderr
. Only the result of the command is sent tostdout
. - For commands that launch a program without an expected result (server), logs are sent to
stdout
.
Consequences
- End users who use
stdout
logs would have a breaking change. They will have to retrieve the logs that come fromstderr
in addition. - Commands
genesis
,era
andtools
from Mithril aggregator now send their logs tostderr
.