19 #ifndef RCUTILS__LOGGING_MACROS_H_ 20 #define RCUTILS__LOGGING_MACROS_H_ 33 #define RCUTILS_LOG_MIN_SEVERITY_DEBUG 0 34 #define RCUTILS_LOG_MIN_SEVERITY_INFO 1 35 #define RCUTILS_LOG_MIN_SEVERITY_WARN 2 36 #define RCUTILS_LOG_MIN_SEVERITY_ERROR 3 37 #define RCUTILS_LOG_MIN_SEVERITY_FATAL 4 38 #define RCUTILS_LOG_MIN_SEVERITY_NONE 5 46 #ifndef RCUTILS_LOG_MIN_SEVERITY 47 #define RCUTILS_LOG_MIN_SEVERITY RCUTILS_LOG_MIN_SEVERITY_DEBUG 63 #define RCUTILS_LOG_COND_NAMED(severity, condition_before, condition_after, name, ...) \ 65 RCUTILS_LOGGING_AUTOINIT \ 66 static rcutils_log_location_t __rcutils_logging_location = {__func__, __FILE__, __LINE__}; \ 67 if (rcutils_logging_logger_is_enabled_for(name, severity)) { \ 69 rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \ 80 #define RCUTILS_LOG_CONDITION_EMPTY 91 #define RCUTILS_LOG_CONDITION_ONCE_BEFORE \ 93 static int __rcutils_logging_once = 0; \ 94 if (RCUTILS_UNLIKELY(0 == __rcutils_logging_once)) { \ 95 __rcutils_logging_once = 1; 100 #define RCUTILS_LOG_CONDITION_ONCE_AFTER } \ 112 #define RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression) \ 118 #define RCUTILS_LOG_CONDITION_EXPRESSION_AFTER } 134 #define RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function) \ 140 #define RCUTILS_LOG_CONDITION_FUNCTION_AFTER } 151 #define RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE \ 153 static bool __rcutils_logging_first = true; \ 154 if (RCUTILS_UNLIKELY(true == __rcutils_logging_first)) { \ 155 __rcutils_logging_first = false; \ 161 #define RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER } \ 173 #define RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) { \ 174 static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS((rcutils_duration_value_t)duration); \ 175 static rcutils_time_point_value_t __rcutils_logging_last_logged = 0; \ 176 rcutils_time_point_value_t __rcutils_logging_now = 0; \ 177 bool __rcutils_logging_condition = true; \ 178 if (rcutils_steady_time_now(&__rcutils_logging_now) != RCUTILS_RET_OK) { \ 180 &__rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, "", \ 181 "%s() at %s:%d getting current steady time failed\n", \ 182 __func__, __FILE__, __LINE__); \ 184 __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \ 187 if (RCUTILS_LIKELY(__rcutils_logging_condition)) { \ 188 __rcutils_logging_last_logged = __rcutils_logging_now; 194 #define RCUTILS_LOG_CONDITION_THROTTLE_AFTER } \ 200 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_DEBUG) 204 # define RCUTILS_LOG_DEBUG(format, ...) 205 # define RCUTILS_LOG_DEBUG_NAMED(name, format, ...) 207 # define RCUTILS_LOG_DEBUG_ONCE(format, ...) 209 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, format, ...) 211 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, format, ...) 213 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, format, ...) 215 # define RCUTILS_LOG_DEBUG_FUNCTION(function, format, ...) 217 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, format, ...) 219 # define RCUTILS_LOG_DEBUG_SKIPFIRST(format, ...) 221 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, format, ...) 223 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, format, ...) 225 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 227 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 229 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 238 # define RCUTILS_LOG_DEBUG(...) \ 239 RCUTILS_LOG_COND_NAMED( \ 240 RCUTILS_LOG_SEVERITY_DEBUG, \ 241 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 249 # define RCUTILS_LOG_DEBUG_NAMED(name, ...) \ 250 RCUTILS_LOG_COND_NAMED( \ 251 RCUTILS_LOG_SEVERITY_DEBUG, \ 252 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 263 # define RCUTILS_LOG_DEBUG_ONCE(...) \ 264 RCUTILS_LOG_COND_NAMED( \ 265 RCUTILS_LOG_SEVERITY_DEBUG, \ 266 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 278 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, ...) \ 279 RCUTILS_LOG_COND_NAMED( \ 280 RCUTILS_LOG_SEVERITY_DEBUG, \ 281 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 293 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, ...) \ 294 RCUTILS_LOG_COND_NAMED( \ 295 RCUTILS_LOG_SEVERITY_DEBUG, \ 296 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 309 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, ...) \ 310 RCUTILS_LOG_COND_NAMED( \ 311 RCUTILS_LOG_SEVERITY_DEBUG, \ 312 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 324 # define RCUTILS_LOG_DEBUG_FUNCTION(function, ...) \ 325 RCUTILS_LOG_COND_NAMED( \ 326 RCUTILS_LOG_SEVERITY_DEBUG, \ 327 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 340 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, ...) \ 341 RCUTILS_LOG_COND_NAMED( \ 342 RCUTILS_LOG_SEVERITY_DEBUG, \ 343 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 354 # define RCUTILS_LOG_DEBUG_SKIPFIRST(...) \ 355 RCUTILS_LOG_COND_NAMED( \ 356 RCUTILS_LOG_SEVERITY_DEBUG, \ 357 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 369 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, ...) \ 370 RCUTILS_LOG_COND_NAMED( \ 371 RCUTILS_LOG_SEVERITY_DEBUG, \ 372 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 385 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, ...) \ 386 RCUTILS_LOG_COND_NAMED( \ 387 RCUTILS_LOG_SEVERITY_DEBUG, \ 388 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 402 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 403 RCUTILS_LOG_COND_NAMED( \ 404 RCUTILS_LOG_SEVERITY_DEBUG, \ 405 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 419 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 420 RCUTILS_LOG_COND_NAMED( \ 421 RCUTILS_LOG_SEVERITY_DEBUG, \ 422 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 437 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 438 RCUTILS_LOG_COND_NAMED( \ 439 RCUTILS_LOG_SEVERITY_DEBUG, \ 440 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 447 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_INFO) 451 # define RCUTILS_LOG_INFO(format, ...) 452 # define RCUTILS_LOG_INFO_NAMED(name, format, ...) 454 # define RCUTILS_LOG_INFO_ONCE(format, ...) 456 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, format, ...) 458 # define RCUTILS_LOG_INFO_EXPRESSION(expression, format, ...) 460 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, format, ...) 462 # define RCUTILS_LOG_INFO_FUNCTION(function, format, ...) 464 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, format, ...) 466 # define RCUTILS_LOG_INFO_SKIPFIRST(format, ...) 468 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, format, ...) 470 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, format, ...) 472 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 474 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 476 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 485 # define RCUTILS_LOG_INFO(...) \ 486 RCUTILS_LOG_COND_NAMED( \ 487 RCUTILS_LOG_SEVERITY_INFO, \ 488 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 496 # define RCUTILS_LOG_INFO_NAMED(name, ...) \ 497 RCUTILS_LOG_COND_NAMED( \ 498 RCUTILS_LOG_SEVERITY_INFO, \ 499 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 510 # define RCUTILS_LOG_INFO_ONCE(...) \ 511 RCUTILS_LOG_COND_NAMED( \ 512 RCUTILS_LOG_SEVERITY_INFO, \ 513 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 525 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, ...) \ 526 RCUTILS_LOG_COND_NAMED( \ 527 RCUTILS_LOG_SEVERITY_INFO, \ 528 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 540 # define RCUTILS_LOG_INFO_EXPRESSION(expression, ...) \ 541 RCUTILS_LOG_COND_NAMED( \ 542 RCUTILS_LOG_SEVERITY_INFO, \ 543 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 556 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, ...) \ 557 RCUTILS_LOG_COND_NAMED( \ 558 RCUTILS_LOG_SEVERITY_INFO, \ 559 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 571 # define RCUTILS_LOG_INFO_FUNCTION(function, ...) \ 572 RCUTILS_LOG_COND_NAMED( \ 573 RCUTILS_LOG_SEVERITY_INFO, \ 574 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 587 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, ...) \ 588 RCUTILS_LOG_COND_NAMED( \ 589 RCUTILS_LOG_SEVERITY_INFO, \ 590 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 601 # define RCUTILS_LOG_INFO_SKIPFIRST(...) \ 602 RCUTILS_LOG_COND_NAMED( \ 603 RCUTILS_LOG_SEVERITY_INFO, \ 604 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 616 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, ...) \ 617 RCUTILS_LOG_COND_NAMED( \ 618 RCUTILS_LOG_SEVERITY_INFO, \ 619 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 632 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, ...) \ 633 RCUTILS_LOG_COND_NAMED( \ 634 RCUTILS_LOG_SEVERITY_INFO, \ 635 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 649 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 650 RCUTILS_LOG_COND_NAMED( \ 651 RCUTILS_LOG_SEVERITY_INFO, \ 652 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 666 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 667 RCUTILS_LOG_COND_NAMED( \ 668 RCUTILS_LOG_SEVERITY_INFO, \ 669 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 684 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 685 RCUTILS_LOG_COND_NAMED( \ 686 RCUTILS_LOG_SEVERITY_INFO, \ 687 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 694 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_WARN) 698 # define RCUTILS_LOG_WARN(format, ...) 699 # define RCUTILS_LOG_WARN_NAMED(name, format, ...) 701 # define RCUTILS_LOG_WARN_ONCE(format, ...) 703 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, format, ...) 705 # define RCUTILS_LOG_WARN_EXPRESSION(expression, format, ...) 707 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, format, ...) 709 # define RCUTILS_LOG_WARN_FUNCTION(function, format, ...) 711 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, format, ...) 713 # define RCUTILS_LOG_WARN_SKIPFIRST(format, ...) 715 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, format, ...) 717 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, format, ...) 719 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 721 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 723 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 732 # define RCUTILS_LOG_WARN(...) \ 733 RCUTILS_LOG_COND_NAMED( \ 734 RCUTILS_LOG_SEVERITY_WARN, \ 735 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 743 # define RCUTILS_LOG_WARN_NAMED(name, ...) \ 744 RCUTILS_LOG_COND_NAMED( \ 745 RCUTILS_LOG_SEVERITY_WARN, \ 746 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 757 # define RCUTILS_LOG_WARN_ONCE(...) \ 758 RCUTILS_LOG_COND_NAMED( \ 759 RCUTILS_LOG_SEVERITY_WARN, \ 760 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 772 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, ...) \ 773 RCUTILS_LOG_COND_NAMED( \ 774 RCUTILS_LOG_SEVERITY_WARN, \ 775 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 787 # define RCUTILS_LOG_WARN_EXPRESSION(expression, ...) \ 788 RCUTILS_LOG_COND_NAMED( \ 789 RCUTILS_LOG_SEVERITY_WARN, \ 790 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 803 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, ...) \ 804 RCUTILS_LOG_COND_NAMED( \ 805 RCUTILS_LOG_SEVERITY_WARN, \ 806 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 818 # define RCUTILS_LOG_WARN_FUNCTION(function, ...) \ 819 RCUTILS_LOG_COND_NAMED( \ 820 RCUTILS_LOG_SEVERITY_WARN, \ 821 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 834 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, ...) \ 835 RCUTILS_LOG_COND_NAMED( \ 836 RCUTILS_LOG_SEVERITY_WARN, \ 837 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 848 # define RCUTILS_LOG_WARN_SKIPFIRST(...) \ 849 RCUTILS_LOG_COND_NAMED( \ 850 RCUTILS_LOG_SEVERITY_WARN, \ 851 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 863 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, ...) \ 864 RCUTILS_LOG_COND_NAMED( \ 865 RCUTILS_LOG_SEVERITY_WARN, \ 866 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 879 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, ...) \ 880 RCUTILS_LOG_COND_NAMED( \ 881 RCUTILS_LOG_SEVERITY_WARN, \ 882 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 896 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 897 RCUTILS_LOG_COND_NAMED( \ 898 RCUTILS_LOG_SEVERITY_WARN, \ 899 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 913 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 914 RCUTILS_LOG_COND_NAMED( \ 915 RCUTILS_LOG_SEVERITY_WARN, \ 916 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 931 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 932 RCUTILS_LOG_COND_NAMED( \ 933 RCUTILS_LOG_SEVERITY_WARN, \ 934 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 941 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_ERROR) 945 # define RCUTILS_LOG_ERROR(format, ...) 946 # define RCUTILS_LOG_ERROR_NAMED(name, format, ...) 948 # define RCUTILS_LOG_ERROR_ONCE(format, ...) 950 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, format, ...) 952 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, format, ...) 954 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, format, ...) 956 # define RCUTILS_LOG_ERROR_FUNCTION(function, format, ...) 958 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, format, ...) 960 # define RCUTILS_LOG_ERROR_SKIPFIRST(format, ...) 962 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, format, ...) 964 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, format, ...) 966 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 968 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 970 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 979 # define RCUTILS_LOG_ERROR(...) \ 980 RCUTILS_LOG_COND_NAMED( \ 981 RCUTILS_LOG_SEVERITY_ERROR, \ 982 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 990 # define RCUTILS_LOG_ERROR_NAMED(name, ...) \ 991 RCUTILS_LOG_COND_NAMED( \ 992 RCUTILS_LOG_SEVERITY_ERROR, \ 993 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1004 # define RCUTILS_LOG_ERROR_ONCE(...) \ 1005 RCUTILS_LOG_COND_NAMED( \ 1006 RCUTILS_LOG_SEVERITY_ERROR, \ 1007 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 1019 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, ...) \ 1020 RCUTILS_LOG_COND_NAMED( \ 1021 RCUTILS_LOG_SEVERITY_ERROR, \ 1022 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1034 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, ...) \ 1035 RCUTILS_LOG_COND_NAMED( \ 1036 RCUTILS_LOG_SEVERITY_ERROR, \ 1037 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 1050 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, ...) \ 1051 RCUTILS_LOG_COND_NAMED( \ 1052 RCUTILS_LOG_SEVERITY_ERROR, \ 1053 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1065 # define RCUTILS_LOG_ERROR_FUNCTION(function, ...) \ 1066 RCUTILS_LOG_COND_NAMED( \ 1067 RCUTILS_LOG_SEVERITY_ERROR, \ 1068 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 1081 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, ...) \ 1082 RCUTILS_LOG_COND_NAMED( \ 1083 RCUTILS_LOG_SEVERITY_ERROR, \ 1084 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1095 # define RCUTILS_LOG_ERROR_SKIPFIRST(...) \ 1096 RCUTILS_LOG_COND_NAMED( \ 1097 RCUTILS_LOG_SEVERITY_ERROR, \ 1098 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1110 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, ...) \ 1111 RCUTILS_LOG_COND_NAMED( \ 1112 RCUTILS_LOG_SEVERITY_ERROR, \ 1113 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1126 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, ...) \ 1127 RCUTILS_LOG_COND_NAMED( \ 1128 RCUTILS_LOG_SEVERITY_ERROR, \ 1129 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 1143 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1144 RCUTILS_LOG_COND_NAMED( \ 1145 RCUTILS_LOG_SEVERITY_ERROR, \ 1146 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1160 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1161 RCUTILS_LOG_COND_NAMED( \ 1162 RCUTILS_LOG_SEVERITY_ERROR, \ 1163 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1178 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1179 RCUTILS_LOG_COND_NAMED( \ 1180 RCUTILS_LOG_SEVERITY_ERROR, \ 1181 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1188 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_FATAL) 1192 # define RCUTILS_LOG_FATAL(format, ...) 1193 # define RCUTILS_LOG_FATAL_NAMED(name, format, ...) 1195 # define RCUTILS_LOG_FATAL_ONCE(format, ...) 1197 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, format, ...) 1199 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, format, ...) 1201 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, format, ...) 1203 # define RCUTILS_LOG_FATAL_FUNCTION(function, format, ...) 1205 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, format, ...) 1207 # define RCUTILS_LOG_FATAL_SKIPFIRST(format, ...) 1209 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, format, ...) 1211 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, format, ...) 1213 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 1215 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1217 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1226 # define RCUTILS_LOG_FATAL(...) \ 1227 RCUTILS_LOG_COND_NAMED( \ 1228 RCUTILS_LOG_SEVERITY_FATAL, \ 1229 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 1237 # define RCUTILS_LOG_FATAL_NAMED(name, ...) \ 1238 RCUTILS_LOG_COND_NAMED( \ 1239 RCUTILS_LOG_SEVERITY_FATAL, \ 1240 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1251 # define RCUTILS_LOG_FATAL_ONCE(...) \ 1252 RCUTILS_LOG_COND_NAMED( \ 1253 RCUTILS_LOG_SEVERITY_FATAL, \ 1254 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 1266 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, ...) \ 1267 RCUTILS_LOG_COND_NAMED( \ 1268 RCUTILS_LOG_SEVERITY_FATAL, \ 1269 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1281 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, ...) \ 1282 RCUTILS_LOG_COND_NAMED( \ 1283 RCUTILS_LOG_SEVERITY_FATAL, \ 1284 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 1297 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, ...) \ 1298 RCUTILS_LOG_COND_NAMED( \ 1299 RCUTILS_LOG_SEVERITY_FATAL, \ 1300 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1312 # define RCUTILS_LOG_FATAL_FUNCTION(function, ...) \ 1313 RCUTILS_LOG_COND_NAMED( \ 1314 RCUTILS_LOG_SEVERITY_FATAL, \ 1315 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 1328 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, ...) \ 1329 RCUTILS_LOG_COND_NAMED( \ 1330 RCUTILS_LOG_SEVERITY_FATAL, \ 1331 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1342 # define RCUTILS_LOG_FATAL_SKIPFIRST(...) \ 1343 RCUTILS_LOG_COND_NAMED( \ 1344 RCUTILS_LOG_SEVERITY_FATAL, \ 1345 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1357 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, ...) \ 1358 RCUTILS_LOG_COND_NAMED( \ 1359 RCUTILS_LOG_SEVERITY_FATAL, \ 1360 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1373 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, ...) \ 1374 RCUTILS_LOG_COND_NAMED( \ 1375 RCUTILS_LOG_SEVERITY_FATAL, \ 1376 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 1390 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1391 RCUTILS_LOG_COND_NAMED( \ 1392 RCUTILS_LOG_SEVERITY_FATAL, \ 1393 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1407 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1408 RCUTILS_LOG_COND_NAMED( \ 1409 RCUTILS_LOG_SEVERITY_FATAL, \ 1410 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1425 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1426 RCUTILS_LOG_COND_NAMED( \ 1427 RCUTILS_LOG_SEVERITY_FATAL, \ 1428 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1437 #endif // RCUTILS__LOGGING_MACROS_H_ bool(* RclLogFilter)()
Definition: logging_macros.h:129