spa: support: remove log pattern support

The log patterns are now handled by plugin host.
This commit is contained in:
Pauli Virtanen 2023-12-23 21:24:54 +02:00 committed by Wim Taymans
parent dd8d5e1bed
commit 53ba3d0e4c
5 changed files with 1 additions and 144 deletions

View file

@ -21,8 +21,6 @@
#include <systemd/sd-journal.h>
#include "log-patterns.h"
#define NAME "journal"
#define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_INFO
@ -33,8 +31,6 @@ struct impl {
/* if non-null, we'll additionally forward all logging to there */
struct spa_log *chain_log;
struct spa_list patterns;
};
static SPA_PRINTF_FUNC(7,0) void
@ -143,22 +139,12 @@ impl_log_logt(void *object,
va_end(args);
}
static void
impl_log_topic_init(void *object, struct spa_log_topic *t)
{
struct impl *impl = object;
enum spa_log_level level = impl->log.level;
support_log_topic_init(&impl->patterns, level, t);
}
static const struct spa_log_methods impl_log = {
SPA_VERSION_LOG_METHODS,
.log = impl_log_log,
.logv = impl_log_logv,
.logt = impl_log_logt,
.logtv = impl_log_logtv,
.topic_init = impl_log_topic_init,
};
static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface)
@ -180,12 +166,11 @@ static int impl_get_interface(struct spa_handle *handle, const char *type, void
static int impl_clear(struct spa_handle *handle)
{
struct impl *this;
struct impl SPA_UNUSED *this;
spa_return_val_if_fail(handle != NULL, -EINVAL);
this = (struct impl *) handle;
support_log_free_patterns(&this->patterns);
return 0;
}
@ -251,13 +236,9 @@ impl_init(const struct spa_handle_factory *factory,
&impl_log, impl);
impl->log.level = DEFAULT_LOG_LEVEL;
spa_list_init(&impl->patterns);
if (info) {
if ((str = spa_dict_lookup(info, SPA_KEY_LOG_LEVEL)) != NULL)
impl->log.level = atoi(str);
if ((str = spa_dict_lookup(info, SPA_KEY_LOG_PATTERNS)) != NULL)
support_log_parse_patterns(&impl->patterns, str);
}
/* if our stderr goes to the journal, there's no point in logging both