19 #ifndef RCUTILS__LOGGING_MACROS_H_ 20 #define RCUTILS__LOGGING_MACROS_H_ 37 #ifndef RCUTILS_LOG_MIN_SEVERITY 38 #define RCUTILS_LOG_MIN_SEVERITY RCUTILS_LOG_SEVERITY_DEBUG 50 #define RCUTILS_LOG_COND_NAMED(severity, condition_before, condition_after, name, ...) \ 52 RCUTILS_LOGGING_AUTOINIT \ 53 static rcutils_log_location_t __rcutils_logging_location = {__func__, __FILE__, __LINE__}; \ 55 if (severity >= g_rcutils_logging_severity_threshold) { \ 56 rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \ 67 #define RCUTILS_LOG_CONDITION_EMPTY 78 #define RCUTILS_LOG_CONDITION_ONCE_BEFORE \ 80 static int __rcutils_logging_once = 0; \ 81 if (RCUTILS_UNLIKELY(0 == __rcutils_logging_once)) { \ 82 __rcutils_logging_once = 1; 87 #define RCUTILS_LOG_CONDITION_ONCE_AFTER } \ 99 #define RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression) \ 105 #define RCUTILS_LOG_CONDITION_EXPRESSION_AFTER } 121 #define RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function) \ 127 #define RCUTILS_LOG_CONDITION_FUNCTION_AFTER } 138 #define RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE \ 140 static bool __rcutils_logging_first = true; \ 141 if (RCUTILS_UNLIKELY(true == __rcutils_logging_first)) { \ 142 __rcutils_logging_first = false; \ 148 #define RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER } \ 160 #define RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) { \ 161 static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS((rcutils_duration_value_t)duration); \ 162 static rcutils_time_point_value_t __rcutils_logging_last_logged = 0; \ 163 rcutils_time_point_value_t __rcutils_logging_now = 0; \ 164 bool __rcutils_logging_condition = true; \ 165 if (rcutils_steady_time_now(&__rcutils_logging_now) != RCUTILS_RET_OK) { \ 167 &__rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, "", \ 168 "%s() at %s:%d getting current steady time failed\n", \ 169 __func__, __FILE__, __LINE__); \ 171 __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \ 174 if (RCUTILS_LIKELY(__rcutils_logging_condition)) { \ 175 __rcutils_logging_last_logged = __rcutils_logging_now; 181 #define RCUTILS_LOG_CONDITION_THROTTLE_AFTER } \ 187 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_DEBUG) 191 # define RCUTILS_LOG_DEBUG(format, ...) 192 # define RCUTILS_LOG_DEBUG_NAMED(name, format, ...) 194 # define RCUTILS_LOG_DEBUG_ONCE(format, ...) 196 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, format, ...) 198 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, format, ...) 200 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, format, ...) 202 # define RCUTILS_LOG_DEBUG_FUNCTION(function, format, ...) 204 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, format, ...) 206 # define RCUTILS_LOG_DEBUG_SKIPFIRST(format, ...) 208 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, format, ...) 210 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, format, ...) 212 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 214 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 216 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 225 # define RCUTILS_LOG_DEBUG(...) \ 226 RCUTILS_LOG_COND_NAMED( \ 227 RCUTILS_LOG_SEVERITY_DEBUG, \ 228 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 236 # define RCUTILS_LOG_DEBUG_NAMED(name, ...) \ 237 RCUTILS_LOG_COND_NAMED( \ 238 RCUTILS_LOG_SEVERITY_DEBUG, \ 239 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 247 # define RCUTILS_LOG_DEBUG_ONCE(...) \ 248 RCUTILS_LOG_COND_NAMED( \ 249 RCUTILS_LOG_SEVERITY_DEBUG, \ 250 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 259 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, ...) \ 260 RCUTILS_LOG_COND_NAMED( \ 261 RCUTILS_LOG_SEVERITY_DEBUG, \ 262 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 271 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, ...) \ 272 RCUTILS_LOG_COND_NAMED( \ 273 RCUTILS_LOG_SEVERITY_DEBUG, \ 274 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 285 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, ...) \ 286 RCUTILS_LOG_COND_NAMED( \ 287 RCUTILS_LOG_SEVERITY_DEBUG, \ 288 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 297 # define RCUTILS_LOG_DEBUG_FUNCTION(function, ...) \ 298 RCUTILS_LOG_COND_NAMED( \ 299 RCUTILS_LOG_SEVERITY_DEBUG, \ 300 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 311 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, ...) \ 312 RCUTILS_LOG_COND_NAMED( \ 313 RCUTILS_LOG_SEVERITY_DEBUG, \ 314 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 322 # define RCUTILS_LOG_DEBUG_SKIPFIRST(...) \ 323 RCUTILS_LOG_COND_NAMED( \ 324 RCUTILS_LOG_SEVERITY_DEBUG, \ 325 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 334 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, ...) \ 335 RCUTILS_LOG_COND_NAMED( \ 336 RCUTILS_LOG_SEVERITY_DEBUG, \ 337 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 347 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, ...) \ 348 RCUTILS_LOG_COND_NAMED( \ 349 RCUTILS_LOG_SEVERITY_DEBUG, \ 350 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 361 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 362 RCUTILS_LOG_COND_NAMED( \ 363 RCUTILS_LOG_SEVERITY_DEBUG, \ 364 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 375 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 376 RCUTILS_LOG_COND_NAMED( \ 377 RCUTILS_LOG_SEVERITY_DEBUG, \ 378 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 390 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 391 RCUTILS_LOG_COND_NAMED( \ 392 RCUTILS_LOG_SEVERITY_DEBUG, \ 393 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, \ 400 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_INFO) 404 # define RCUTILS_LOG_INFO(format, ...) 405 # define RCUTILS_LOG_INFO_NAMED(name, format, ...) 407 # define RCUTILS_LOG_INFO_ONCE(format, ...) 409 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, format, ...) 411 # define RCUTILS_LOG_INFO_EXPRESSION(expression, format, ...) 413 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, format, ...) 415 # define RCUTILS_LOG_INFO_FUNCTION(function, format, ...) 417 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, format, ...) 419 # define RCUTILS_LOG_INFO_SKIPFIRST(format, ...) 421 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, format, ...) 423 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, format, ...) 425 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 427 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 429 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 438 # define RCUTILS_LOG_INFO(...) \ 439 RCUTILS_LOG_COND_NAMED( \ 440 RCUTILS_LOG_SEVERITY_INFO, \ 441 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 449 # define RCUTILS_LOG_INFO_NAMED(name, ...) \ 450 RCUTILS_LOG_COND_NAMED( \ 451 RCUTILS_LOG_SEVERITY_INFO, \ 452 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 460 # define RCUTILS_LOG_INFO_ONCE(...) \ 461 RCUTILS_LOG_COND_NAMED( \ 462 RCUTILS_LOG_SEVERITY_INFO, \ 463 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 472 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, ...) \ 473 RCUTILS_LOG_COND_NAMED( \ 474 RCUTILS_LOG_SEVERITY_INFO, \ 475 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 484 # define RCUTILS_LOG_INFO_EXPRESSION(expression, ...) \ 485 RCUTILS_LOG_COND_NAMED( \ 486 RCUTILS_LOG_SEVERITY_INFO, \ 487 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 498 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, ...) \ 499 RCUTILS_LOG_COND_NAMED( \ 500 RCUTILS_LOG_SEVERITY_INFO, \ 501 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 510 # define RCUTILS_LOG_INFO_FUNCTION(function, ...) \ 511 RCUTILS_LOG_COND_NAMED( \ 512 RCUTILS_LOG_SEVERITY_INFO, \ 513 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 524 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, ...) \ 525 RCUTILS_LOG_COND_NAMED( \ 526 RCUTILS_LOG_SEVERITY_INFO, \ 527 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 535 # define RCUTILS_LOG_INFO_SKIPFIRST(...) \ 536 RCUTILS_LOG_COND_NAMED( \ 537 RCUTILS_LOG_SEVERITY_INFO, \ 538 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 547 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, ...) \ 548 RCUTILS_LOG_COND_NAMED( \ 549 RCUTILS_LOG_SEVERITY_INFO, \ 550 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 560 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, ...) \ 561 RCUTILS_LOG_COND_NAMED( \ 562 RCUTILS_LOG_SEVERITY_INFO, \ 563 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 574 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 575 RCUTILS_LOG_COND_NAMED( \ 576 RCUTILS_LOG_SEVERITY_INFO, \ 577 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 588 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 589 RCUTILS_LOG_COND_NAMED( \ 590 RCUTILS_LOG_SEVERITY_INFO, \ 591 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 603 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 604 RCUTILS_LOG_COND_NAMED( \ 605 RCUTILS_LOG_SEVERITY_INFO, \ 606 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, \ 613 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_WARN) 617 # define RCUTILS_LOG_WARN(format, ...) 618 # define RCUTILS_LOG_WARN_NAMED(name, format, ...) 620 # define RCUTILS_LOG_WARN_ONCE(format, ...) 622 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, format, ...) 624 # define RCUTILS_LOG_WARN_EXPRESSION(expression, format, ...) 626 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, format, ...) 628 # define RCUTILS_LOG_WARN_FUNCTION(function, format, ...) 630 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, format, ...) 632 # define RCUTILS_LOG_WARN_SKIPFIRST(format, ...) 634 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, format, ...) 636 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, format, ...) 638 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 640 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 642 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 651 # define RCUTILS_LOG_WARN(...) \ 652 RCUTILS_LOG_COND_NAMED( \ 653 RCUTILS_LOG_SEVERITY_WARN, \ 654 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 662 # define RCUTILS_LOG_WARN_NAMED(name, ...) \ 663 RCUTILS_LOG_COND_NAMED( \ 664 RCUTILS_LOG_SEVERITY_WARN, \ 665 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 673 # define RCUTILS_LOG_WARN_ONCE(...) \ 674 RCUTILS_LOG_COND_NAMED( \ 675 RCUTILS_LOG_SEVERITY_WARN, \ 676 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 685 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, ...) \ 686 RCUTILS_LOG_COND_NAMED( \ 687 RCUTILS_LOG_SEVERITY_WARN, \ 688 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 697 # define RCUTILS_LOG_WARN_EXPRESSION(expression, ...) \ 698 RCUTILS_LOG_COND_NAMED( \ 699 RCUTILS_LOG_SEVERITY_WARN, \ 700 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 711 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, ...) \ 712 RCUTILS_LOG_COND_NAMED( \ 713 RCUTILS_LOG_SEVERITY_WARN, \ 714 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 723 # define RCUTILS_LOG_WARN_FUNCTION(function, ...) \ 724 RCUTILS_LOG_COND_NAMED( \ 725 RCUTILS_LOG_SEVERITY_WARN, \ 726 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 737 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, ...) \ 738 RCUTILS_LOG_COND_NAMED( \ 739 RCUTILS_LOG_SEVERITY_WARN, \ 740 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 748 # define RCUTILS_LOG_WARN_SKIPFIRST(...) \ 749 RCUTILS_LOG_COND_NAMED( \ 750 RCUTILS_LOG_SEVERITY_WARN, \ 751 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 760 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, ...) \ 761 RCUTILS_LOG_COND_NAMED( \ 762 RCUTILS_LOG_SEVERITY_WARN, \ 763 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 773 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, ...) \ 774 RCUTILS_LOG_COND_NAMED( \ 775 RCUTILS_LOG_SEVERITY_WARN, \ 776 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 787 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 788 RCUTILS_LOG_COND_NAMED( \ 789 RCUTILS_LOG_SEVERITY_WARN, \ 790 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 801 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 802 RCUTILS_LOG_COND_NAMED( \ 803 RCUTILS_LOG_SEVERITY_WARN, \ 804 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 816 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 817 RCUTILS_LOG_COND_NAMED( \ 818 RCUTILS_LOG_SEVERITY_WARN, \ 819 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, \ 826 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_ERROR) 830 # define RCUTILS_LOG_ERROR(format, ...) 831 # define RCUTILS_LOG_ERROR_NAMED(name, format, ...) 833 # define RCUTILS_LOG_ERROR_ONCE(format, ...) 835 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, format, ...) 837 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, format, ...) 839 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, format, ...) 841 # define RCUTILS_LOG_ERROR_FUNCTION(function, format, ...) 843 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, format, ...) 845 # define RCUTILS_LOG_ERROR_SKIPFIRST(format, ...) 847 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, format, ...) 849 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, format, ...) 851 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 853 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 855 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 864 # define RCUTILS_LOG_ERROR(...) \ 865 RCUTILS_LOG_COND_NAMED( \ 866 RCUTILS_LOG_SEVERITY_ERROR, \ 867 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 875 # define RCUTILS_LOG_ERROR_NAMED(name, ...) \ 876 RCUTILS_LOG_COND_NAMED( \ 877 RCUTILS_LOG_SEVERITY_ERROR, \ 878 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 886 # define RCUTILS_LOG_ERROR_ONCE(...) \ 887 RCUTILS_LOG_COND_NAMED( \ 888 RCUTILS_LOG_SEVERITY_ERROR, \ 889 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 898 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, ...) \ 899 RCUTILS_LOG_COND_NAMED( \ 900 RCUTILS_LOG_SEVERITY_ERROR, \ 901 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 910 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, ...) \ 911 RCUTILS_LOG_COND_NAMED( \ 912 RCUTILS_LOG_SEVERITY_ERROR, \ 913 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 924 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, ...) \ 925 RCUTILS_LOG_COND_NAMED( \ 926 RCUTILS_LOG_SEVERITY_ERROR, \ 927 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 936 # define RCUTILS_LOG_ERROR_FUNCTION(function, ...) \ 937 RCUTILS_LOG_COND_NAMED( \ 938 RCUTILS_LOG_SEVERITY_ERROR, \ 939 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 950 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, ...) \ 951 RCUTILS_LOG_COND_NAMED( \ 952 RCUTILS_LOG_SEVERITY_ERROR, \ 953 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 961 # define RCUTILS_LOG_ERROR_SKIPFIRST(...) \ 962 RCUTILS_LOG_COND_NAMED( \ 963 RCUTILS_LOG_SEVERITY_ERROR, \ 964 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 973 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, ...) \ 974 RCUTILS_LOG_COND_NAMED( \ 975 RCUTILS_LOG_SEVERITY_ERROR, \ 976 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 986 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, ...) \ 987 RCUTILS_LOG_COND_NAMED( \ 988 RCUTILS_LOG_SEVERITY_ERROR, \ 989 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 1000 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1001 RCUTILS_LOG_COND_NAMED( \ 1002 RCUTILS_LOG_SEVERITY_ERROR, \ 1003 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1014 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1015 RCUTILS_LOG_COND_NAMED( \ 1016 RCUTILS_LOG_SEVERITY_ERROR, \ 1017 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1029 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1030 RCUTILS_LOG_COND_NAMED( \ 1031 RCUTILS_LOG_SEVERITY_ERROR, \ 1032 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, \ 1039 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_FATAL) 1043 # define RCUTILS_LOG_FATAL(format, ...) 1044 # define RCUTILS_LOG_FATAL_NAMED(name, format, ...) 1046 # define RCUTILS_LOG_FATAL_ONCE(format, ...) 1048 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, format, ...) 1050 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, format, ...) 1052 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, format, ...) 1054 # define RCUTILS_LOG_FATAL_FUNCTION(function, format, ...) 1056 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, format, ...) 1058 # define RCUTILS_LOG_FATAL_SKIPFIRST(format, ...) 1060 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, format, ...) 1062 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, format, ...) 1064 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 1066 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1068 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1077 # define RCUTILS_LOG_FATAL(...) \ 1078 RCUTILS_LOG_COND_NAMED( \ 1079 RCUTILS_LOG_SEVERITY_FATAL, \ 1080 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 1088 # define RCUTILS_LOG_FATAL_NAMED(name, ...) \ 1089 RCUTILS_LOG_COND_NAMED( \ 1090 RCUTILS_LOG_SEVERITY_FATAL, \ 1091 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1099 # define RCUTILS_LOG_FATAL_ONCE(...) \ 1100 RCUTILS_LOG_COND_NAMED( \ 1101 RCUTILS_LOG_SEVERITY_FATAL, \ 1102 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 1111 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, ...) \ 1112 RCUTILS_LOG_COND_NAMED( \ 1113 RCUTILS_LOG_SEVERITY_FATAL, \ 1114 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1123 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, ...) \ 1124 RCUTILS_LOG_COND_NAMED( \ 1125 RCUTILS_LOG_SEVERITY_FATAL, \ 1126 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 1137 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, ...) \ 1138 RCUTILS_LOG_COND_NAMED( \ 1139 RCUTILS_LOG_SEVERITY_FATAL, \ 1140 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1149 # define RCUTILS_LOG_FATAL_FUNCTION(function, ...) \ 1150 RCUTILS_LOG_COND_NAMED( \ 1151 RCUTILS_LOG_SEVERITY_FATAL, \ 1152 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 1163 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, ...) \ 1164 RCUTILS_LOG_COND_NAMED( \ 1165 RCUTILS_LOG_SEVERITY_FATAL, \ 1166 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1174 # define RCUTILS_LOG_FATAL_SKIPFIRST(...) \ 1175 RCUTILS_LOG_COND_NAMED( \ 1176 RCUTILS_LOG_SEVERITY_FATAL, \ 1177 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1186 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, ...) \ 1187 RCUTILS_LOG_COND_NAMED( \ 1188 RCUTILS_LOG_SEVERITY_FATAL, \ 1189 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1199 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, ...) \ 1200 RCUTILS_LOG_COND_NAMED( \ 1201 RCUTILS_LOG_SEVERITY_FATAL, \ 1202 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 1213 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1214 RCUTILS_LOG_COND_NAMED( \ 1215 RCUTILS_LOG_SEVERITY_FATAL, \ 1216 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1227 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1228 RCUTILS_LOG_COND_NAMED( \ 1229 RCUTILS_LOG_SEVERITY_FATAL, \ 1230 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1242 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1243 RCUTILS_LOG_COND_NAMED( \ 1244 RCUTILS_LOG_SEVERITY_FATAL, \ 1245 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, \ 1254 #endif // RCUTILS__LOGGING_MACROS_H_ bool(* RclLogFilter)()
Definition: logging_macros.h:116