31 static const char *
const levels[] = {
"-",
"E",
"W",
"I",
"D",
"T" };
33 const char *basename = strrchr(file,
'/');
34 char text[512], location[1024];
35 char topicstr[32] = {0};
42 if (topic && topic->topic)
43 snprintf(topicstr,
sizeof(topicstr),
" %s ", topic->topic);
44 vsnprintf(text,
sizeof(text), fmt, args);
45 snprintf(location,
sizeof(location),
"[%s]%s[%s:%i %s()] %s\n",
48 basename, line, func, text);
49 fputs(location, stderr);
96#define SPA_LOG_IMPL_DEFINE(name) \
99 struct spa_log_methods methods; \
102#define SPA_LOG_IMPL_INIT(name) \
103 { { { SPA_TYPE_INTERFACE_Log, SPA_VERSION_LOG, \
104 SPA_CALLBACKS_INIT(&(name).methods, &(name)) }, \
105 SPA_LOG_LEVEL_INFO, }, \
106 { SPA_VERSION_LOG_METHODS, \
110 spa_log_impl_logtv, \
111 spa_log_impl_topic_init, \
114#define SPA_LOG_IMPL(name) \
115 SPA_LOG_IMPL_DEFINE(name) = SPA_LOG_IMPL_INIT(name)
spa_log_level
Definition log.h:45
static void spa_log_impl_log(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt,...)
Definition log-impl.h:83
static void spa_log_impl_logtv(void *object, enum spa_log_level level, const struct spa_log_topic *topic, const char *file, int line, const char *func, const char *fmt, va_list args)
Definition log-impl.h:27
static void spa_log_impl_logt(void *object, enum spa_log_level level, const struct spa_log_topic *topic, const char *file, int line, const char *func, const char *fmt,...)
Definition log-impl.h:57
static void spa_log_impl_logv(void *object, enum spa_log_level level, const char *file, int line, const char *func, const char *fmt, va_list args)
Definition log-impl.h:71
static void spa_log_impl_topic_init(void *object, struct spa_log_topic *topic 1)
Definition log-impl.h:96
#define SPA_UNUSED
Definition defs.h:289
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition defs.h:277
Identifier for a topic.
Definition log.h:83