-
Notifications
You must be signed in to change notification settings - Fork 283
Description
Description
I propose to move logger.terminal_colors
out of the configuration file to the layer of application's CLI args parsing, which happens before the config file is read and parsed.
Why
"Terminal colors" configure whether the overall Command Line Interface should be colorized or not. Therefore, it belongs to the layer of CLI args, not the config file. Moreover, I don't see a reason why logger output colors in terminal should differ from any other terminal output of Iroha.
Also, configuration parsing happens after CLI arguments parsing. The process of configuration parsing itself might involve logging of hints/warnings/errors with or without colors. If terminal_colors
is set in the config file, it will be only available after the config is parsed. Thus, this option should be known before configuration parsing stage.
Changes
- Remove
logger.terminal_colors
parameter from config file - Introduce
--terminal-colors
CLI argument with a corresponding ENV var (e.g.TERMINAL_COLORS
)
Also
- Currently terminal colors is automatically enabled/disabled accordingly to TTY color detection (if
logger.terminal_colors
is not set). This behaviour will stay the same.