diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-06-21 13:29:52 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-06-21 13:29:52 +0200 |
commit | 4494f9c7c927d4d7b6f69bb172a352ed2eeb70de (patch) | |
tree | 423b4c2d784fb3de72fea20300bbee9809ba263d /src | |
parent | 5b7e95c71cf63832e515343f32af02ba21fbbe81 (diff) |
log: use temporary log first
Use the default log implementation as a default log until a more
complete one is installed. This way we get log early.
Diffstat (limited to 'src')
-rw-r--r-- | src/pipewire/log.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pipewire/log.c b/src/pipewire/log.c index 19c81c3a..bb9332a6 100644 --- a/src/pipewire/log.c +++ b/src/pipewire/log.c @@ -22,14 +22,18 @@ * DEALINGS IN THE SOFTWARE. */ +#include <spa/support/log-impl.h> + #include <pipewire/log.h> +SPA_LOG_IMPL(default_log); + #define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_ERROR SPA_EXPORT enum spa_log_level pw_log_level = DEFAULT_LOG_LEVEL; -static struct spa_log *global_log = NULL; +static struct spa_log *global_log = &default_log.log; /** Set the global log interface * \param log the global log to set @@ -83,7 +87,7 @@ pw_log_log(enum spa_log_level level, const char *func, const char *fmt, ...) { - if (SPA_UNLIKELY(pw_log_level_enabled(level) && global_log)) { + if (SPA_UNLIKELY(pw_log_level_enabled(level))) { va_list args; va_start(args, fmt); spa_interface_call(&global_log->iface, @@ -112,7 +116,7 @@ pw_log_logv(enum spa_log_level level, const char *fmt, va_list args) { - if (SPA_UNLIKELY(pw_log_level_enabled(level) && global_log)) { + if (SPA_UNLIKELY(pw_log_level_enabled(level))) { spa_interface_call(&global_log->iface, struct spa_log_methods, logv, 0, level, file, line, func, fmt, args); |