Attributing libunit logging function for arguments validation.

This commit is contained in:
Max Romanov
2020-03-30 14:08:20 +03:00
parent f94e31b294
commit 82b899b136
4 changed files with 31 additions and 10 deletions

View File

@@ -356,10 +356,29 @@ int nxt_unit_websocket_retain(nxt_unit_websocket_frame_t *ws);
void nxt_unit_websocket_done(nxt_unit_websocket_frame_t *ws);
void nxt_unit_log(nxt_unit_ctx_t *ctx, int level, const char* fmt, ...);
#if defined __has_attribute
#if __has_attribute(format)
#define NXT_ATTR_FORMAT __attribute__((format(printf, 3, 4)))
#endif
#endif
#if !defined(NXT_ATTR_FORMAT)
#define NXT_ATTR_FORMAT
#endif
void nxt_unit_log(nxt_unit_ctx_t *ctx, int level, const char* fmt, ...)
NXT_ATTR_FORMAT;
void nxt_unit_req_log(nxt_unit_request_info_t *req, int level,
const char* fmt, ...);
const char* fmt, ...) NXT_ATTR_FORMAT;
#if (NXT_DEBUG)