logger: Add a mechanism to force colourised logging

This is handy if we want to redirect to a file but have colours to make
manual parsing easier (for example with `less -R`).
This commit is contained in:
Arun Raghavan 2023-08-08 08:23:31 -04:00 committed by Wim Taymans
parent 17cda59478
commit 86bd0eb708
4 changed files with 20 additions and 6 deletions

View file

@ -284,7 +284,8 @@ do { \
/** keys can be given when initializing the logger handle */
#define SPA_KEY_LOG_LEVEL "log.level" /**< the default log level */
#define SPA_KEY_LOG_COLORS "log.colors" /**< enable colors in the logger */
#define SPA_KEY_LOG_COLORS "log.colors" /**< enable colors in the logger, set to "force" to enable
* colors even when not logging to a terminal */
#define SPA_KEY_LOG_FILE "log.file" /**< log to the specified file instead of
* stderr. */
#define SPA_KEY_LOG_TIMESTAMP "log.timestamp" /**< log timestamps */