mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
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:
parent
17cda59478
commit
86bd0eb708
4 changed files with 20 additions and 6 deletions
|
|
@ -598,8 +598,11 @@ void pw_init(int *argc, char **argv[])
|
|||
char *patterns = NULL;
|
||||
|
||||
n_items = 0;
|
||||
if (!support->no_color)
|
||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, "true");
|
||||
if (!support->no_color) {
|
||||
if ((str = getenv("PIPEWIRE_LOG_COLOR")) == NULL)
|
||||
str = "true";
|
||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, str);
|
||||
}
|
||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_TIMESTAMP, "true");
|
||||
if ((str = getenv("PIPEWIRE_LOG_LINE")) == NULL || spa_atob(str))
|
||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_LINE, "true");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue