]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to get logger level
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Aug 2021 09:40:56 +0000 (10:40 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Aug 2021 09:40:56 +0000 (10:40 +0100)
src/libserver/logger/logger.c
src/libserver/logger/logger_private.h

index 0c7400ebf87342ed5c9ded92181dde18df934849..f65d0fb2ea69dc338e5599511d751fc72e7f75b6 100644 (file)
@@ -48,11 +48,23 @@ rspamd_log_emergency_logger (void)
 void
 rspamd_log_set_log_level (rspamd_logger_t *logger, gint level)
 {
-       g_assert (logger != NULL);
+       if (logger == NULL) {
+               logger = default_logger;
+       }
 
        logger->log_level = level;
 }
 
+gint
+rspamd_log_get_log_level (rspamd_logger_t *logger)
+{
+       if (logger == NULL) {
+               logger = default_logger;
+       }
+
+       return logger->log_level;
+}
+
 void
 rspamd_log_set_log_flags (rspamd_logger_t *logger, gint flags)
 {
index 92bdfdba7b1dd3bd88b1cddd731f54d8828d7768..cb06abe7cfff37b47ffa8cca47f704317378d5f1 100644 (file)
@@ -168,7 +168,6 @@ bool rspamd_log_console_log (const gchar *module, const gchar *id,
                                                        gsize mlen,
                                                        rspamd_logger_t *rspamd_log,
                                                        gpointer arg);
-const gchar *rspamd_get_log_severity_string(gint level_flags);
 
 static const struct rspamd_logger_funcs console_log_funcs = {
                .init = rspamd_log_console_init,