diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-16 17:03:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-16 17:05:02 +0100 |
commit | 95492aa853706b30d32c04bdbf6fc79b90de41e4 (patch) | |
tree | 77212bc11d9fccf84db2b7b10c71012417ed3422 /src/libutil | |
parent | db25f46740511104bbe565f20914b4aabec7864e (diff) | |
download | rspamd-95492aa853706b30d32c04bdbf6fc79b90de41e4.tar.gz rspamd-95492aa853706b30d32c04bdbf6fc79b90de41e4.zip |
[Feature] Log URLs encrypted if we have log encryption pubkey
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/logger.c | 2 | ||||
-rw-r--r-- | src/libutil/logger.h | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c index a57eacfa6..0b90fb969 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -497,7 +497,7 @@ rspamd_common_logv (rspamd_logger_t *rspamd_log, gint level_flags, const gchar *fmt, va_list args) { gchar logbuf[RSPAMD_LOGBUF_SIZE], *end; - gint level = level_flags & (RSPAMD_LOG_LEVEL_MASK|G_LOG_LEVEL_MASK); + gint level = level_flags & (RSPAMD_LOG_LEVEL_MASK & G_LOG_LEVEL_MASK); if (rspamd_log == NULL) { rspamd_log = default_logger; diff --git a/src/libutil/logger.h b/src/libutil/logger.h index d84c64b90..f3ba9da28 100644 --- a/src/libutil/logger.h +++ b/src/libutil/logger.h @@ -192,6 +192,22 @@ const guint64* rspamd_log_counters (rspamd_logger_t *logger); task->task_pool->tag.tagname, task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +#define msg_err_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_CRITICAL|RSPAMD_LOG_ENCRYPTED, \ + task->task_pool->tag.tagname, task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) +#define msg_warn_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_WARNING|RSPAMD_LOG_ENCRYPTED, \ + task->task_pool->tag.tagname, task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) +#define msg_info_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_INFO|RSPAMD_LOG_ENCRYPTED, \ + task->task_pool->tag.tagname, task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) +#define msg_debug_task_encrypted(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG|RSPAMD_LOG_ENCRYPTED, \ + task->task_pool->tag.tagname, task->task_pool->tag.uid, \ + G_STRFUNC, \ + __VA_ARGS__) /* Check for NULL pointer first */ #define msg_err_task_check(...) rspamd_default_log_function (G_LOG_LEVEL_CRITICAL, \ task ? task->task_pool->tag.tagname : NULL, task ? task->task_pool->tag.uid : NULL, \ |