aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-11 14:41:51 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-11 14:41:51 +0100
commit0b4bffde43bb88131e76929219eecf609a018094 (patch)
tree3cb5a664a3d5f5428e20f21b063e98280ec57f56
parent663fd45b40244aaf6d8fe1db705dbc609a68c89a (diff)
downloadrspamd-0b4bffde43bb88131e76929219eecf609a018094.tar.gz
rspamd-0b4bffde43bb88131e76929219eecf609a018094.zip
[Minor] Add utility to get a logger singleton
-rw-r--r--src/libutil/logger.c6
-rw-r--r--src/libutil/logger.h6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index cd624f831..f55e3529a 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -1478,4 +1478,10 @@ rspamd_logger_configure_modules (GHashTable *mods_enabled)
setbit (log_modules->bitset, id);
}
}
+}
+
+rspamd_logger_t*
+rspamd_logger_get_singleton (void)
+{
+ return default_logger;
} \ No newline at end of file
diff --git a/src/libutil/logger.h b/src/libutil/logger.h
index bfb36ed1d..b6bc40bdd 100644
--- a/src/libutil/logger.h
+++ b/src/libutil/logger.h
@@ -183,6 +183,12 @@ const guint64* rspamd_log_counters (rspamd_logger_t *logger);
*/
ucl_object_t * rspamd_log_errorbuf_export (const rspamd_logger_t *logger);
+/**
+ * Returns the current logger object
+ * @return
+ */
+rspamd_logger_t* rspamd_logger_get_singleton (void);
+
/* Typical functions */
extern guint rspamd_task_log_id;