Skip to content

[suggestion] Move logger.terminal_colors setting to the CLI layer #4030

@0x009922

Description

@0x009922

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.

Metadata

Metadata

Assignees

Labels

config-changesChanges in configuration and start up of the Irohairoha2-devThe re-implementation of a BFT hyperledger in RUST

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions