ulog icon indicating copy to clipboard operation
ulog copied to clipboard

Disabling logging breaks compilation

Open lcavalli opened this issue 3 years ago • 1 comments

Hi, disabling logging by undefining ULOG_ENABLED breaks compilation due to the replacement of functions with empty do loops.

image

Also, checking returned values may be a problem with empty loops:

ULOG_INIT();
ulogErr = ULOG_SUBSCRIBE(console_logger, ULOG_TRACE_LEVEL);
assert(ulogErr == ULOG_ERR_NONE);

lcavalli avatar Aug 02 '22 09:08 lcavalli

Initialization and configuration are in few specific places and can be disabled by the caller. Logging function are disabled in ulog if ULOG_EBALED is unset.

Proposed pull request to fix the issue: https://github.com/rdpoor/ulog/pull/10

lcavalli avatar Aug 02 '22 14:08 lcavalli