diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-14 13:20:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-14 13:20:00 +0000 |
commit | 3ef2188db541900063c6275fe032d56221fdc738 (patch) | |
tree | c355241164299356b2bf178b716ee9d05d852f16 /src/libutil/logger.c | |
parent | 01e27f52fa7dfcf6b47dda784e01c379fd61906c (diff) | |
download | rspamd-3ef2188db541900063c6275fe032d56221fdc738.tar.gz rspamd-3ef2188db541900063c6275fe032d56221fdc738.zip |
[Minor] Add structures to store errors in the buffer
Diffstat (limited to 'src/libutil/logger.c')
-rw-r--r-- | src/libutil/logger.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 0b90fb969..227b66f7e 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -33,6 +33,24 @@ #define LOG_ID 6 #define RSPAMD_LOGBUF_SIZE 8192 +struct rspamd_logger_error_elt { + GQuark ptype; + pid_t pid; + time_t ts; + guchar id[LOG_ID]; + gchar module[10]; + gchar message[]; +}; + +struct rspamd_logger_error_log { + struct rspamd_logger_error_elt *elts; + guint32 max_elts; + /* Avoid false cache sharing */ + guint32 __pad32; + guchar __padding[64 - sizeof(gpointer) - sizeof(guint64)]; + guint cur_row; +}; + /** * Static structure that store logging parameters * It is NOT shared between processes and is created by main process @@ -40,6 +58,7 @@ struct rspamd_logger_s { rspamd_log_func_t log_func; struct rspamd_config *cfg; + struct rspamd_logger_error_log *errlog; struct rspamd_cryptobox_pubkey *pk; struct rspamd_cryptobox_keypair *keypair; struct { |