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 66 #define RCUTILS_LOG_COND_NAMED(severity, condition_before, condition_after, name, ...) \ 68 RCUTILS_LOGGING_AUTOINIT \ 69 static rcutils_log_location_t __rcutils_logging_location = {__func__, __FILE__, __LINE__}; \ 70 if (rcutils_logging_logger_is_enabled_for(name, severity)) { \ 72 rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \ 83 #define RCUTILS_LOG_CONDITION_EMPTY 94 #define RCUTILS_LOG_CONDITION_ONCE_BEFORE \ 96 static int __rcutils_logging_once = 0; \ 97 if (RCUTILS_UNLIKELY(0 == __rcutils_logging_once)) { \ 98 __rcutils_logging_once = 1; 103 #define RCUTILS_LOG_CONDITION_ONCE_AFTER } \ 115 #define RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression) \ 121 #define RCUTILS_LOG_CONDITION_EXPRESSION_AFTER } 137 #define RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function) \ 143 #define RCUTILS_LOG_CONDITION_FUNCTION_AFTER } 154 #define RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE \ 156 static bool __rcutils_logging_first = true; \ 157 if (RCUTILS_UNLIKELY(true == __rcutils_logging_first)) { \ 158 __rcutils_logging_first = false; \ 164 #define RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER } \ 176 #define RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) { \ 177 static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS((rcutils_duration_value_t)duration); \ 178 static rcutils_time_point_value_t __rcutils_logging_last_logged = 0; \ 179 rcutils_time_point_value_t __rcutils_logging_now = 0; \ 180 bool __rcutils_logging_condition = true; \ 181 if (get_time_point_value(&__rcutils_logging_now) != RCUTILS_RET_OK) { \ 183 &__rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, "", \ 184 "%s() at %s:%d getting current steady time failed\n", \ 185 __func__, __FILE__, __LINE__); \ 187 __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \ 190 if (RCUTILS_LIKELY(__rcutils_logging_condition)) { \ 191 __rcutils_logging_last_logged = __rcutils_logging_now; 197 #define RCUTILS_LOG_CONDITION_THROTTLE_AFTER } \ 203 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_DEBUG) 207 # define RCUTILS_LOG_DEBUG(format, ...) 208 # define RCUTILS_LOG_DEBUG_NAMED(name, format, ...) 210 # define RCUTILS_LOG_DEBUG_ONCE(format, ...) 212 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, format, ...) 214 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, format, ...) 216 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, format, ...) 218 # define RCUTILS_LOG_DEBUG_FUNCTION(function, format, ...) 220 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, format, ...) 222 # define RCUTILS_LOG_DEBUG_SKIPFIRST(format, ...) 224 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, format, ...) 226 # define RCUTILS_LOG_DEBUG_THROTTLE(get_time_point_value, duration, format, ...) 228 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(get_time_point_value, duration, format, ...) 230 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 232 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 241 # define RCUTILS_LOG_DEBUG(...) \ 242 RCUTILS_LOG_COND_NAMED( \ 243 RCUTILS_LOG_SEVERITY_DEBUG, \ 244 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 252 # define RCUTILS_LOG_DEBUG_NAMED(name, ...) \ 253 RCUTILS_LOG_COND_NAMED( \ 254 RCUTILS_LOG_SEVERITY_DEBUG, \ 255 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 266 # define RCUTILS_LOG_DEBUG_ONCE(...) \ 267 RCUTILS_LOG_COND_NAMED( \ 268 RCUTILS_LOG_SEVERITY_DEBUG, \ 269 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 281 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, ...) \ 282 RCUTILS_LOG_COND_NAMED( \ 283 RCUTILS_LOG_SEVERITY_DEBUG, \ 284 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 296 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, ...) \ 297 RCUTILS_LOG_COND_NAMED( \ 298 RCUTILS_LOG_SEVERITY_DEBUG, \ 299 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 312 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, ...) \ 313 RCUTILS_LOG_COND_NAMED( \ 314 RCUTILS_LOG_SEVERITY_DEBUG, \ 315 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 327 # define RCUTILS_LOG_DEBUG_FUNCTION(function, ...) \ 328 RCUTILS_LOG_COND_NAMED( \ 329 RCUTILS_LOG_SEVERITY_DEBUG, \ 330 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 343 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, ...) \ 344 RCUTILS_LOG_COND_NAMED( \ 345 RCUTILS_LOG_SEVERITY_DEBUG, \ 346 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 357 # define RCUTILS_LOG_DEBUG_SKIPFIRST(...) \ 358 RCUTILS_LOG_COND_NAMED( \ 359 RCUTILS_LOG_SEVERITY_DEBUG, \ 360 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 372 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, ...) \ 373 RCUTILS_LOG_COND_NAMED( \ 374 RCUTILS_LOG_SEVERITY_DEBUG, \ 375 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 388 # define RCUTILS_LOG_DEBUG_THROTTLE(get_time_point_value, duration, ...) \ 389 RCUTILS_LOG_COND_NAMED( \ 390 RCUTILS_LOG_SEVERITY_DEBUG, \ 391 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 405 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(get_time_point_value, duration, ...) \ 406 RCUTILS_LOG_COND_NAMED( \ 407 RCUTILS_LOG_SEVERITY_DEBUG, \ 408 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 422 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 423 RCUTILS_LOG_COND_NAMED( \ 424 RCUTILS_LOG_SEVERITY_DEBUG, \ 425 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 440 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 441 RCUTILS_LOG_COND_NAMED( \ 442 RCUTILS_LOG_SEVERITY_DEBUG, \ 443 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 450 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_INFO) 454 # define RCUTILS_LOG_INFO(format, ...) 455 # define RCUTILS_LOG_INFO_NAMED(name, format, ...) 457 # define RCUTILS_LOG_INFO_ONCE(format, ...) 459 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, format, ...) 461 # define RCUTILS_LOG_INFO_EXPRESSION(expression, format, ...) 463 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, format, ...) 465 # define RCUTILS_LOG_INFO_FUNCTION(function, format, ...) 467 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, format, ...) 469 # define RCUTILS_LOG_INFO_SKIPFIRST(format, ...) 471 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, format, ...) 473 # define RCUTILS_LOG_INFO_THROTTLE(get_time_point_value, duration, format, ...) 475 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(get_time_point_value, duration, format, ...) 477 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 479 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 488 # define RCUTILS_LOG_INFO(...) \ 489 RCUTILS_LOG_COND_NAMED( \ 490 RCUTILS_LOG_SEVERITY_INFO, \ 491 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 499 # define RCUTILS_LOG_INFO_NAMED(name, ...) \ 500 RCUTILS_LOG_COND_NAMED( \ 501 RCUTILS_LOG_SEVERITY_INFO, \ 502 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 513 # define RCUTILS_LOG_INFO_ONCE(...) \ 514 RCUTILS_LOG_COND_NAMED( \ 515 RCUTILS_LOG_SEVERITY_INFO, \ 516 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 528 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, ...) \ 529 RCUTILS_LOG_COND_NAMED( \ 530 RCUTILS_LOG_SEVERITY_INFO, \ 531 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 543 # define RCUTILS_LOG_INFO_EXPRESSION(expression, ...) \ 544 RCUTILS_LOG_COND_NAMED( \ 545 RCUTILS_LOG_SEVERITY_INFO, \ 546 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 559 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, ...) \ 560 RCUTILS_LOG_COND_NAMED( \ 561 RCUTILS_LOG_SEVERITY_INFO, \ 562 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 574 # define RCUTILS_LOG_INFO_FUNCTION(function, ...) \ 575 RCUTILS_LOG_COND_NAMED( \ 576 RCUTILS_LOG_SEVERITY_INFO, \ 577 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 590 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, ...) \ 591 RCUTILS_LOG_COND_NAMED( \ 592 RCUTILS_LOG_SEVERITY_INFO, \ 593 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 604 # define RCUTILS_LOG_INFO_SKIPFIRST(...) \ 605 RCUTILS_LOG_COND_NAMED( \ 606 RCUTILS_LOG_SEVERITY_INFO, \ 607 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 619 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, ...) \ 620 RCUTILS_LOG_COND_NAMED( \ 621 RCUTILS_LOG_SEVERITY_INFO, \ 622 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 635 # define RCUTILS_LOG_INFO_THROTTLE(get_time_point_value, duration, ...) \ 636 RCUTILS_LOG_COND_NAMED( \ 637 RCUTILS_LOG_SEVERITY_INFO, \ 638 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 652 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(get_time_point_value, duration, ...) \ 653 RCUTILS_LOG_COND_NAMED( \ 654 RCUTILS_LOG_SEVERITY_INFO, \ 655 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 669 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 670 RCUTILS_LOG_COND_NAMED( \ 671 RCUTILS_LOG_SEVERITY_INFO, \ 672 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 687 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 688 RCUTILS_LOG_COND_NAMED( \ 689 RCUTILS_LOG_SEVERITY_INFO, \ 690 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 697 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_WARN) 701 # define RCUTILS_LOG_WARN(format, ...) 702 # define RCUTILS_LOG_WARN_NAMED(name, format, ...) 704 # define RCUTILS_LOG_WARN_ONCE(format, ...) 706 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, format, ...) 708 # define RCUTILS_LOG_WARN_EXPRESSION(expression, format, ...) 710 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, format, ...) 712 # define RCUTILS_LOG_WARN_FUNCTION(function, format, ...) 714 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, format, ...) 716 # define RCUTILS_LOG_WARN_SKIPFIRST(format, ...) 718 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, format, ...) 720 # define RCUTILS_LOG_WARN_THROTTLE(get_time_point_value, duration, format, ...) 722 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(get_time_point_value, duration, format, ...) 724 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 726 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 735 # define RCUTILS_LOG_WARN(...) \ 736 RCUTILS_LOG_COND_NAMED( \ 737 RCUTILS_LOG_SEVERITY_WARN, \ 738 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 746 # define RCUTILS_LOG_WARN_NAMED(name, ...) \ 747 RCUTILS_LOG_COND_NAMED( \ 748 RCUTILS_LOG_SEVERITY_WARN, \ 749 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 760 # define RCUTILS_LOG_WARN_ONCE(...) \ 761 RCUTILS_LOG_COND_NAMED( \ 762 RCUTILS_LOG_SEVERITY_WARN, \ 763 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 775 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, ...) \ 776 RCUTILS_LOG_COND_NAMED( \ 777 RCUTILS_LOG_SEVERITY_WARN, \ 778 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 790 # define RCUTILS_LOG_WARN_EXPRESSION(expression, ...) \ 791 RCUTILS_LOG_COND_NAMED( \ 792 RCUTILS_LOG_SEVERITY_WARN, \ 793 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 806 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, ...) \ 807 RCUTILS_LOG_COND_NAMED( \ 808 RCUTILS_LOG_SEVERITY_WARN, \ 809 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 821 # define RCUTILS_LOG_WARN_FUNCTION(function, ...) \ 822 RCUTILS_LOG_COND_NAMED( \ 823 RCUTILS_LOG_SEVERITY_WARN, \ 824 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 837 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, ...) \ 838 RCUTILS_LOG_COND_NAMED( \ 839 RCUTILS_LOG_SEVERITY_WARN, \ 840 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 851 # define RCUTILS_LOG_WARN_SKIPFIRST(...) \ 852 RCUTILS_LOG_COND_NAMED( \ 853 RCUTILS_LOG_SEVERITY_WARN, \ 854 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 866 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, ...) \ 867 RCUTILS_LOG_COND_NAMED( \ 868 RCUTILS_LOG_SEVERITY_WARN, \ 869 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 882 # define RCUTILS_LOG_WARN_THROTTLE(get_time_point_value, duration, ...) \ 883 RCUTILS_LOG_COND_NAMED( \ 884 RCUTILS_LOG_SEVERITY_WARN, \ 885 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 899 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(get_time_point_value, duration, ...) \ 900 RCUTILS_LOG_COND_NAMED( \ 901 RCUTILS_LOG_SEVERITY_WARN, \ 902 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 916 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 917 RCUTILS_LOG_COND_NAMED( \ 918 RCUTILS_LOG_SEVERITY_WARN, \ 919 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 934 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 935 RCUTILS_LOG_COND_NAMED( \ 936 RCUTILS_LOG_SEVERITY_WARN, \ 937 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 944 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_ERROR) 948 # define RCUTILS_LOG_ERROR(format, ...) 949 # define RCUTILS_LOG_ERROR_NAMED(name, format, ...) 951 # define RCUTILS_LOG_ERROR_ONCE(format, ...) 953 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, format, ...) 955 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, format, ...) 957 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, format, ...) 959 # define RCUTILS_LOG_ERROR_FUNCTION(function, format, ...) 961 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, format, ...) 963 # define RCUTILS_LOG_ERROR_SKIPFIRST(format, ...) 965 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, format, ...) 967 # define RCUTILS_LOG_ERROR_THROTTLE(get_time_point_value, duration, format, ...) 969 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(get_time_point_value, duration, format, ...) 971 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 973 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 982 # define RCUTILS_LOG_ERROR(...) \ 983 RCUTILS_LOG_COND_NAMED( \ 984 RCUTILS_LOG_SEVERITY_ERROR, \ 985 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 993 # define RCUTILS_LOG_ERROR_NAMED(name, ...) \ 994 RCUTILS_LOG_COND_NAMED( \ 995 RCUTILS_LOG_SEVERITY_ERROR, \ 996 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1007 # define RCUTILS_LOG_ERROR_ONCE(...) \ 1008 RCUTILS_LOG_COND_NAMED( \ 1009 RCUTILS_LOG_SEVERITY_ERROR, \ 1010 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 1022 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, ...) \ 1023 RCUTILS_LOG_COND_NAMED( \ 1024 RCUTILS_LOG_SEVERITY_ERROR, \ 1025 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1037 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, ...) \ 1038 RCUTILS_LOG_COND_NAMED( \ 1039 RCUTILS_LOG_SEVERITY_ERROR, \ 1040 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 1053 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, ...) \ 1054 RCUTILS_LOG_COND_NAMED( \ 1055 RCUTILS_LOG_SEVERITY_ERROR, \ 1056 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1068 # define RCUTILS_LOG_ERROR_FUNCTION(function, ...) \ 1069 RCUTILS_LOG_COND_NAMED( \ 1070 RCUTILS_LOG_SEVERITY_ERROR, \ 1071 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 1084 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, ...) \ 1085 RCUTILS_LOG_COND_NAMED( \ 1086 RCUTILS_LOG_SEVERITY_ERROR, \ 1087 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1098 # define RCUTILS_LOG_ERROR_SKIPFIRST(...) \ 1099 RCUTILS_LOG_COND_NAMED( \ 1100 RCUTILS_LOG_SEVERITY_ERROR, \ 1101 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1113 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, ...) \ 1114 RCUTILS_LOG_COND_NAMED( \ 1115 RCUTILS_LOG_SEVERITY_ERROR, \ 1116 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1129 # define RCUTILS_LOG_ERROR_THROTTLE(get_time_point_value, duration, ...) \ 1130 RCUTILS_LOG_COND_NAMED( \ 1131 RCUTILS_LOG_SEVERITY_ERROR, \ 1132 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 1146 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(get_time_point_value, duration, ...) \ 1147 RCUTILS_LOG_COND_NAMED( \ 1148 RCUTILS_LOG_SEVERITY_ERROR, \ 1149 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1163 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 1164 RCUTILS_LOG_COND_NAMED( \ 1165 RCUTILS_LOG_SEVERITY_ERROR, \ 1166 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1181 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 1182 RCUTILS_LOG_COND_NAMED( \ 1183 RCUTILS_LOG_SEVERITY_ERROR, \ 1184 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1191 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_MIN_SEVERITY_FATAL) 1195 # define RCUTILS_LOG_FATAL(format, ...) 1196 # define RCUTILS_LOG_FATAL_NAMED(name, format, ...) 1198 # define RCUTILS_LOG_FATAL_ONCE(format, ...) 1200 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, format, ...) 1202 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, format, ...) 1204 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, format, ...) 1206 # define RCUTILS_LOG_FATAL_FUNCTION(function, format, ...) 1208 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, format, ...) 1210 # define RCUTILS_LOG_FATAL_SKIPFIRST(format, ...) 1212 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, format, ...) 1214 # define RCUTILS_LOG_FATAL_THROTTLE(get_time_point_value, duration, format, ...) 1216 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(get_time_point_value, duration, format, ...) 1218 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 1220 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, format, ...) 1229 # define RCUTILS_LOG_FATAL(...) \ 1230 RCUTILS_LOG_COND_NAMED( \ 1231 RCUTILS_LOG_SEVERITY_FATAL, \ 1232 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, NULL, \ 1240 # define RCUTILS_LOG_FATAL_NAMED(name, ...) \ 1241 RCUTILS_LOG_COND_NAMED( \ 1242 RCUTILS_LOG_SEVERITY_FATAL, \ 1243 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1254 # define RCUTILS_LOG_FATAL_ONCE(...) \ 1255 RCUTILS_LOG_COND_NAMED( \ 1256 RCUTILS_LOG_SEVERITY_FATAL, \ 1257 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, NULL, \ 1269 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, ...) \ 1270 RCUTILS_LOG_COND_NAMED( \ 1271 RCUTILS_LOG_SEVERITY_FATAL, \ 1272 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1284 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, ...) \ 1285 RCUTILS_LOG_COND_NAMED( \ 1286 RCUTILS_LOG_SEVERITY_FATAL, \ 1287 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, NULL, \ 1300 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, ...) \ 1301 RCUTILS_LOG_COND_NAMED( \ 1302 RCUTILS_LOG_SEVERITY_FATAL, \ 1303 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1315 # define RCUTILS_LOG_FATAL_FUNCTION(function, ...) \ 1316 RCUTILS_LOG_COND_NAMED( \ 1317 RCUTILS_LOG_SEVERITY_FATAL, \ 1318 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, NULL, \ 1331 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, ...) \ 1332 RCUTILS_LOG_COND_NAMED( \ 1333 RCUTILS_LOG_SEVERITY_FATAL, \ 1334 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1345 # define RCUTILS_LOG_FATAL_SKIPFIRST(...) \ 1346 RCUTILS_LOG_COND_NAMED( \ 1347 RCUTILS_LOG_SEVERITY_FATAL, \ 1348 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1360 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, ...) \ 1361 RCUTILS_LOG_COND_NAMED( \ 1362 RCUTILS_LOG_SEVERITY_FATAL, \ 1363 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1376 # define RCUTILS_LOG_FATAL_THROTTLE(get_time_point_value, duration, ...) \ 1377 RCUTILS_LOG_COND_NAMED( \ 1378 RCUTILS_LOG_SEVERITY_FATAL, \ 1379 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, NULL, \ 1393 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(get_time_point_value, duration, ...) \ 1394 RCUTILS_LOG_COND_NAMED( \ 1395 RCUTILS_LOG_SEVERITY_FATAL, \ 1396 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, NULL, \ 1410 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 1411 RCUTILS_LOG_COND_NAMED( \ 1412 RCUTILS_LOG_SEVERITY_FATAL, \ 1413 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1428 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(get_time_point_value, duration, name, ...) \ 1429 RCUTILS_LOG_COND_NAMED( \ 1430 RCUTILS_LOG_SEVERITY_FATAL, \ 1431 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1440 #endif // RCUTILS__LOGGING_MACROS_H_ bool(* RclLogFilter)()
Definition: logging_macros.h:132