diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-04-27 18:43:22 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-04-27 18:43:22 +0400 |
commit | 02a6d987bbdf55e06375544a14c046d1724f946e (patch) | |
tree | dae44cce3c62f56794fb4245ac86020f27ea7591 /src/logger.h | |
parent | 971bad45c44cf430bde13faede56699ba0381e83 (diff) | |
download | rspamd-02a6d987bbdf55e06375544a14c046d1724f946e.tar.gz rspamd-02a6d987bbdf55e06375544a14c046d1724f946e.zip |
* Improve logging system:
- do not write many repeated messages to log
- add process name to log line
* Small fixes to FreeBSD port and to start script as we have xml version now
* Reconfig modules while rereading config file
Diffstat (limited to 'src/logger.h')
-rw-r--r-- | src/logger.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/logger.h b/src/logger.h index e86901cfc..c923b25ed 100644 --- a/src/logger.h +++ b/src/logger.h @@ -5,30 +5,17 @@ #include "cfg_file.h" #include "radix.h" +/* Forwarded declaration */ +enum process_type; + typedef void (*rspamd_log_func_t)(const gchar * log_domain, const gchar *function, GLogLevelFlags log_level, const gchar * message, gboolean forced, gpointer arg); -typedef struct rspamd_logger_s { - rspamd_log_func_t log_func; - struct config_file *cfg; - struct { - uint32_t size; - uint32_t used; - u_char *buf; - } io_buf; - int fd; - gboolean is_buffered; - gboolean enabled; - enum rspamd_log_type type; - pid_t pid; - radix_tree_t *debug_ip; -} rspamd_logger_t; - /** * Init logger */ -void rspamd_set_logger (enum rspamd_log_type type, struct config_file *cfg); +void rspamd_set_logger (enum rspamd_log_type type, enum process_type ptype, struct config_file *cfg); /** * Open log file or initialize other structures */ @@ -44,7 +31,7 @@ int reopen_log (void); /** * Set log pid */ -void update_log_pid (void); +void update_log_pid (enum process_type ptype); /** * Flush log buffer for some types of logging |