aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-07-29 19:42:26 +0100
committerJoão Valverde <j@v6e.pt>2021-07-29 20:17:44 +0100
commit069367449457b00394685cba73de879f8812d36a (patch)
tree8d9bdcf4b8dd60356320c11d7b6e3c38c8d5348c /wsutil
parent7b845e719444a8f7bc92759c98ca2a07d8af13df (diff)
wslog: Add function to log directly without filtering
Used to write custom logging functions.
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/wslog.c12
-rw-r--r--wsutil/wslog.h13
2 files changed, 25 insertions, 0 deletions
diff --git a/wsutil/wslog.c b/wsutil/wslog.c
index 2c7cef99ae..d6442c61dc 100644
--- a/wsutil/wslog.c
+++ b/wsutil/wslog.c
@@ -896,6 +896,18 @@ void ws_log_full(const char *domain, enum ws_log_level level,
}
+void ws_log_write_always_full(const char *domain, enum ws_log_level level,
+ const char *file, int line, const char *func,
+ const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ log_write_dispatch(domain, level, file, line, func, format, ap);
+ va_end(ap);
+}
+
+
void ws_log_default_writer(const char *domain, enum ws_log_level level,
ws_log_time_t timestamp,
const char *file, int line, const char *func,
diff --git a/wsutil/wslog.h b/wsutil/wslog.h
index 65d0db4385..f656d4fb22 100644
--- a/wsutil/wslog.h
+++ b/wsutil/wslog.h
@@ -296,6 +296,19 @@ void ws_logv_full(const char *domain, enum ws_log_level level,
#define ws_noisy(...) _LOG_DEBUG(LOG_LEVEL_NOISY, __VA_ARGS__)
+/** Auxiliary function to write custom logging functions.
+ *
+ * This function is the same as ws_log_full() but does not perform any
+ * domain/level filtering to avoid a useless double activation check.
+ * It should only be used in conjunction with a pre-check using
+ * ws_log_msg_is_active().
+ */
+WS_DLL_PUBLIC
+void ws_log_write_always_full(const char *domain, enum ws_log_level level,
+ const char *file, int line, const char *func,
+ const char *format, ...) G_GNUC_PRINTF(6,7);
+
+
/** Define an auxiliary file pointer where messages should be written.
*
* This file, if set, functions in addition to the registered or