Skip to content

Commit

Permalink
Add semicolon to end of RCUTILS_LOGGING_AUTOINIT.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette committed Oct 1, 2020
1 parent d8d9599 commit fbb804f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion resource/logging_macros.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extern "C"
*/
#define RCUTILS_LOG_COND_NAMED(severity, condition_before, condition_after, name, ...) \
do { \
RCUTILS_LOGGING_AUTOINIT \
RCUTILS_LOGGING_AUTOINIT; \
static rcutils_log_location_t __rcutils_logging_location = {__func__, __FILE__, __LINE__}; \
if (rcutils_logging_logger_is_enabled_for(name, severity)) { \
condition_before \
Expand Down
22 changes: 9 additions & 13 deletions src/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,39 +342,35 @@ rcutils_logging_severity_level_from_string(

rcutils_logging_output_handler_t rcutils_logging_get_output_handler(void)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
return g_rcutils_logging_output_handler;
}

void rcutils_logging_set_output_handler(rcutils_logging_output_handler_t function)
{
// *INDENT-OFF* (prevent uncrustify from making unnecessary indents here)
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
g_rcutils_logging_output_handler = function;
// *INDENT-ON*
}

int rcutils_logging_get_default_logger_level(void)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
return g_rcutils_logging_default_logger_level;
}

void rcutils_logging_set_default_logger_level(int level)
{
// *INDENT-OFF* (prevent uncrustify from making unnecessary indents here)
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
if (RCUTILS_LOG_SEVERITY_UNSET == level) {
// Restore the default
level = RCUTILS_DEFAULT_LOGGER_DEFAULT_LEVEL;
}
g_rcutils_logging_default_logger_level = level;
// *INDENT-ON*
}

int rcutils_logging_get_logger_level(const char * name)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
if (NULL == name) {
return -1;
}
Expand All @@ -383,7 +379,7 @@ int rcutils_logging_get_logger_level(const char * name)

int rcutils_logging_get_logger_leveln(const char * name, size_t name_length)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
if (NULL == name) {
return -1;
}
Expand Down Expand Up @@ -421,7 +417,7 @@ int rcutils_logging_get_logger_leveln(const char * name, size_t name_length)

int rcutils_logging_get_logger_effective_level(const char * name)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
if (NULL == name) {
return -1;
}
Expand Down Expand Up @@ -453,7 +449,7 @@ int rcutils_logging_get_logger_effective_level(const char * name)

rcutils_ret_t rcutils_logging_set_logger_level(const char * name, int level)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
if (NULL == name) {
RCUTILS_SET_ERROR_MSG("Invalid logger name");
return RCUTILS_RET_INVALID_ARGUMENT;
Expand Down Expand Up @@ -494,7 +490,7 @@ rcutils_ret_t rcutils_logging_set_logger_level(const char * name, int level)

bool rcutils_logging_logger_is_enabled_for(const char * name, int severity)
{
RCUTILS_LOGGING_AUTOINIT
RCUTILS_LOGGING_AUTOINIT;
int logger_level = g_rcutils_logging_default_logger_level;
if (name) {
logger_level = rcutils_logging_get_logger_effective_level(name);
Expand Down

0 comments on commit fbb804f

Please sign in to comment.