diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-03-13 22:18:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-03-13 22:18:38 +0000 |
commit | 46155aca171796396449a55aa24888a9a7372ed6 (patch) | |
tree | 2499f5c7064bd7ddb03695a24e03c6b28304f177 /src/common/log.h | |
parent | d928e5685f1170d907a47ee95e35c9b92c28adef (diff) | |
download | tor-46155aca171796396449a55aa24888a9a7372ed6.tar.gz tor-46155aca171796396449a55aa24888a9a7372ed6.zip |
r18804@catbus: nickm | 2008-03-13 18:18:31 -0400
Refactor log domain mask code so that nobody outside of log.c has to use SEVERITY_MASK_IDX. It is error-prone.
svn:r14016
Diffstat (limited to 'src/common/log.h')
-rw-r--r-- | src/common/log.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/log.h b/src/common/log.h index 994ec7d0ff..c752d40b85 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -104,9 +104,11 @@ typedef struct log_severity_list_t { log_domain_mask_t masks[LOG_DEBUG-LOG_ERR+1]; } log_severity_list_t; +#ifdef LOG_PRIVATE /** Given a severity, yields an index into log_severity_list_t.masks to use * for that severity. */ #define SEVERITY_MASK_IDX(sev) ((sev) - LOG_ERR) +#endif /** Callback type used for add_callback_log. */ typedef void (*log_callback)(int severity, uint32_t domain, const char *msg); @@ -116,6 +118,8 @@ int parse_log_level(const char *level); const char *log_level_to_string(int level); int parse_log_severity_config(const char **cfg, log_severity_list_t *severity_out); +void set_log_severity_config(int minSeverity, int maxSeverity, + log_severity_list_t *severity_out); void add_stream_log(log_severity_list_t *severity, const char *name, FILE *stream); int add_file_log(log_severity_list_t *severity, const char *filename); |