mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pipewire: add PIPEWIRE_LOG environment variable
PIPEWIRE_LOG will redirect logging to a file.
This commit is contained in:
parent
0fe7f9765d
commit
b9e517ee67
1 changed files with 3 additions and 1 deletions
|
|
@ -347,7 +347,7 @@ SPA_EXPORT
|
||||||
void pw_init(int *argc, char **argv[])
|
void pw_init(int *argc, char **argv[])
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
struct spa_dict_item items[2];
|
struct spa_dict_item items[3];
|
||||||
uint32_t n_items;
|
uint32_t n_items;
|
||||||
struct spa_dict info;
|
struct spa_dict info;
|
||||||
struct support *support = &global_support;
|
struct support *support = &global_support;
|
||||||
|
|
@ -377,6 +377,8 @@ void pw_init(int *argc, char **argv[])
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, "1");
|
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, "1");
|
||||||
snprintf(level, sizeof(level), "%d", pw_log_level);
|
snprintf(level, sizeof(level), "%d", pw_log_level);
|
||||||
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_LEVEL, level);
|
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_LEVEL, level);
|
||||||
|
if ((str = getenv("PIPEWIRE_LOG")) != NULL)
|
||||||
|
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_FILE, str);
|
||||||
info = SPA_DICT_INIT(items, n_items);
|
info = SPA_DICT_INIT(items, n_items);
|
||||||
|
|
||||||
log = add_interface(support, SPA_NAME_SUPPORT_LOG, SPA_TYPE_INTERFACE_Log, &info);
|
log = add_interface(support, SPA_NAME_SUPPORT_LOG, SPA_TYPE_INTERFACE_Log, &info);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue