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
stdoutbut 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
stdoutlogs would have a breaking change. They will have to retrieve the logs that come fromstderrin addition. - Commands
genesis,eraandtoolsfrom Mithril aggregator now send their logs tostderr.