Skip to content

Commit

Permalink
Merge pull request #6119 from grom72/CORE_LOG_TO_LAST
Browse files Browse the repository at this point in the history
common: make _CORE_LOG_TO_LAST macro internal (#6119)
  • Loading branch information
grom72 authored Oct 3, 2024
2 parents 193a8a3 + d5e9790 commit 0011065
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ core_log_va(char *buf, size_t buf_len, enum core_log_level level,
/*
* Despite this check is already done when the function is called from
* the CORE_LOG() macro it has to be done here again since it is not
* performed in the case of the CORE_LOG_TO_LAST macro. Sorry.
* performed in the case of the _CORE_LOG_TO_LAST macro. Sorry.
*/
if (level > _core_log_get_threshold_internal())
goto end;
Expand Down
6 changes: 3 additions & 3 deletions src/core/log_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void core_log(enum core_log_level level, int errnum, const char *file_name,
* Can't check the logging level here when logging to the last error message.
* Since the log message has to be generated anyway.
*/
#define CORE_LOG_TO_LAST(errnum, format, ...) \
#define _CORE_LOG_TO_LAST(errnum, format, ...) \
core_log(CORE_LOG_LEVEL_ERROR_LAST, errnum, __FILE__, __LINE__, \
__func__, format, ##__VA_ARGS__)

Expand Down Expand Up @@ -189,10 +189,10 @@ void core_log(enum core_log_level level, int errnum, const char *file_name,
*/

#define CORE_LOG_ERROR_LAST(format, ...) \
CORE_LOG_TO_LAST(NO_ERRNO, format, ##__VA_ARGS__)
_CORE_LOG_TO_LAST(NO_ERRNO, format, ##__VA_ARGS__)

#define CORE_LOG_ERROR_W_ERRNO_LAST(format, ...) \
CORE_LOG_TO_LAST(errno, format ": ", ##__VA_ARGS__);
_CORE_LOG_TO_LAST(errno, format ": ", ##__VA_ARGS__);

/* Aliases */

Expand Down

0 comments on commit 0011065

Please sign in to comment.