diff --git a/include/neatvnc.h b/include/neatvnc.h index 1c610fc..06034ee 100644 --- a/include/neatvnc.h +++ b/include/neatvnc.h @@ -235,6 +235,8 @@ void nvnc_set_cursor(struct nvnc*, struct nvnc_fb*, uint16_t width, uint16_t height, uint16_t hotspot_x, uint16_t hotspot_y, bool is_damaged); +void nvnc_default_logger(const struct nvnc_log_data* meta, const char* message); + void nvnc_set_log_fn(nvnc_log_fn); void nvnc_set_log_level(enum nvnc_log_level); void nvnc__log(const struct nvnc_log_data*, const char* fmt, ...); diff --git a/src/logging.c b/src/logging.c index 76dd15d..1dd651f 100644 --- a/src/logging.c +++ b/src/logging.c @@ -32,10 +32,7 @@ #define EXPORT __attribute__((visibility("default"))) -static void default_logger(const struct nvnc_log_data* meta, - const char* message); - -static nvnc_log_fn log_fn = default_logger; +static nvnc_log_fn log_fn = nvnc_default_logger; #ifndef NDEBUG static enum nvnc_log_level log_level = NVNC_LOG_DEBUG; @@ -107,7 +104,8 @@ static void nvnc__vlog(const struct nvnc_log_data* meta, const char* fmt, abort(); } -static void default_logger(const struct nvnc_log_data* meta, +EXPORT +void nvnc_default_logger(const struct nvnc_log_data* meta, const char* message) { const char* level = log_level_to_string(meta->level);