[Log] Add possibility to disable colorization of log outputs
Context
Add possibility to disable color ANSI escape sequences for the cases where the terminal does not support it or the output is redirected to a file/pipe.
Example 1:
# run unit test without colors in notices/warnings
env AIDGE_LOG_COLOR=off build/unit_tests/tests_aidge_core
Example 2:
# python script
import aidge_core
aidge_core.Log.set_console_color(False)
aidge_core.Log.warn("uncolored warning")
Modified files
-
Log.hpp
: Add setConsoleColor(bool) method to Log module in order to control colorization on log outputs. Default should be assumed true. -
pybind_Log.cpp
: Add set_console_color(bool) python binding. -
Log.cpp
initial value: Add AIDGE_LOG_COLOR=[off|OFF|0] env var to disable colors at startup.
Detailed major modifications
No major modification.
Added a new interface to python and through env vars.
TODO
No TODO forecasted
Merge request reports
Activity
Filter activity
added Enhancement ⭐ label
added 13 commits
-
cccd5dc4...e754cb7b - 12 commits from branch
eclipse/aidge:dev
- fce887fe - [Log] Add possibility to disable colorization of log outputs
-
cccd5dc4...e754cb7b - 12 commits from branch
enabled an automatic merge when the pipeline for fce887fe succeeds
mentioned in commit 6a2d6585
Please register or sign in to reply