From b9e517ee67b833071749293a3c8df8a8e7267c72 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 10 Sep 2019 09:44:05 +0200 Subject: [PATCH] pipewire: add PIPEWIRE_LOG environment variable PIPEWIRE_LOG will redirect logging to a file. --- src/pipewire/pipewire.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index 60851b5ef..a7012ab2f 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -347,7 +347,7 @@ SPA_EXPORT void pw_init(int *argc, char **argv[]) { const char *str; - struct spa_dict_item items[2]; + struct spa_dict_item items[3]; uint32_t n_items; struct spa_dict info; 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"); snprintf(level, sizeof(level), "%d", pw_log_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); log = add_interface(support, SPA_NAME_SUPPORT_LOG, SPA_TYPE_INTERFACE_Log, &info);