diff options
Diffstat (limited to '')
-rw-r--r-- | src/nxt_log.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/src/nxt_log.h b/src/nxt_log.h index f5e60129..48742721 100644 --- a/src/nxt_log.h +++ b/src/nxt_log.h @@ -8,14 +8,12 @@ #define _NXT_LOG_H_INCLUDED_ -#define NXT_LOG_EMERG 0 -#define NXT_LOG_ALERT 1 -#define NXT_LOG_CRIT 2 -#define NXT_LOG_ERR 3 -#define NXT_LOG_WARN 4 -#define NXT_LOG_NOTICE 5 -#define NXT_LOG_INFO 6 -#define NXT_LOG_DEBUG 7 +#define NXT_LOG_ALERT 0 +#define NXT_LOG_ERR 1 +#define NXT_LOG_WARN 2 +#define NXT_LOG_NOTICE 3 +#define NXT_LOG_INFO 4 +#define NXT_LOG_DEBUG 5 #define NXT_MAX_ERROR_STR 2048 @@ -48,21 +46,11 @@ nxt_log_level_enough(log, level) \ ((log)->level >= (level)) -#define \ -nxt_log_emerg(_log, ...) \ +#define nxt_alert(task, ...) \ do { \ - nxt_log_t *_log_ = (_log); \ - \ - _log_->handler(NXT_LOG_EMERG, _log_, __VA_ARGS__); \ - } while (0) - - -#define \ -nxt_log_alert(_log, ...) \ - do { \ - nxt_log_t *_log_ = (_log); \ + nxt_log_t *log = (task)->log; \ \ - _log_->handler(NXT_LOG_ALERT, _log_, __VA_ARGS__); \ + log->handler(NXT_LOG_ALERT, log, __VA_ARGS__); \ } while (0) @@ -87,6 +75,14 @@ nxt_log_alert(_log, ...) \ } while (0) +#define nxt_log_alert(_log, ...) \ + do { \ + nxt_log_t *_log_ = (_log); \ + \ + _log_->handler(NXT_LOG_ALERT, _log_, __VA_ARGS__); \ + } while (0) + + #define \ nxt_log_error(_level, _log, ...) \ do { \ @@ -156,11 +152,6 @@ nxt_log_debug(...) #define \ -nxt_main_log_emerg(...) \ - nxt_log_emerg(&nxt_main_log, __VA_ARGS__) - - -#define \ nxt_main_log_alert(...) \ nxt_log_alert(&nxt_main_log, __VA_ARGS__) |