should I just use pipewire's logging?

This commit is contained in:
Emile Clark-Boman 2025-09-04 11:11:24 +10:00
parent 19403f79ab
commit b86ad339d9
2 changed files with 27 additions and 0 deletions

22
lib/log.c Normal file
View file

@ -0,0 +1,22 @@
#include <stdio.h>
#include <pipewire/pipewire.h>
static FILE *LOG_TARGET;
/* Set file pointer Dorne should log to. */
void drn_log_target(FILE *target) {
LOG_TARGET = target;
}
/* Log to a specific file descriptor (internal method) */
static void drn_log_to(FILE *target, const char *msg) {
fprintf(target, "%s", msg);
}
/* Dorne's standard logging interface.
* WARNING: ensure drn_log_target(...) has been set!
*/
void drn_log(const char *msg) {
drn_log_to(LOG_TARGET, msg);
}