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 47 # define RCUTILS_LIKELY(x) __builtin_expect((x), 1) 52 # define RCUTILS_UNLIKELY(x) __builtin_expect((x), 0) 58 # define RCUTILS_LIKELY(x) (x) 63 # define RCUTILS_UNLIKELY(x) (x) 72 #define RCUTILS_LOGGING_AUTOINIT \ 73 if (RCUTILS_UNLIKELY(!g_rcl_logging_initialized)) { \ 74 rcl_logging_initialize(); \ 86 #define RCUTILS_LOG_COND_NAMED(severity, condition_before, condition_after, name, ...) \ 88 RCUTILS_LOGGING_AUTOINIT \ 89 static rcl_log_location_t __rcutils_logging_location = {__func__, __FILE__, __LINE__}; \ 91 if (severity >= g_rcl_logging_severity_threshold) { \ 92 rcl_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \ 103 #define RCUTILS_LOG_CONDITION_EMPTY 114 #define RCUTILS_LOG_CONDITION_ONCE_BEFORE \ 116 static int __rcutils_logging_once = 0; \ 117 if (RCUTILS_UNLIKELY(0 == __rcutils_logging_once)) { \ 118 __rcutils_logging_once = 1; 123 #define RCUTILS_LOG_CONDITION_ONCE_AFTER } \ 135 #define RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression) \ 141 #define RCUTILS_LOG_CONDITION_EXPRESSION_AFTER } 157 #define RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function) \ 163 #define RCUTILS_LOG_CONDITION_FUNCTION_AFTER } 174 #define RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE \ 176 static bool __rcutils_logging_first = true; \ 177 if (RCUTILS_UNLIKELY(true == __rcutils_logging_first)) { \ 178 __rcutils_logging_first = false; \ 184 #define RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER } \ 196 #define RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) { \ 197 static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS((rcutils_duration_value_t)duration); \ 198 static rcutils_time_point_value_t __rcutils_logging_last_logged = 0; \ 199 rcutils_time_point_value_t __rcutils_logging_now = 0; \ 200 bool __rcutils_logging_condition = true; \ 201 if (rcutils_steady_time_now(&__rcutils_logging_now) != RCUTILS_RET_OK) { \ 203 &__rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, "", \ 204 "%s() at %s:%d getting current steady time failed\n", \ 205 __func__, __FILE__, __LINE__); \ 207 __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \ 210 if (RCUTILS_LIKELY(__rcutils_logging_condition)) { \ 211 __rcutils_logging_last_logged = __rcutils_logging_now; 217 #define RCUTILS_LOG_CONDITION_THROTTLE_AFTER } \ 223 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_DEBUG) 227 # define RCUTILS_LOG_DEBUG(format, ...) 228 # define RCUTILS_LOG_DEBUG_NAMED(name, format, ...) 230 # define RCUTILS_LOG_DEBUG_ONCE(format, ...) 232 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, format, ...) 234 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, format, ...) 236 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, format, ...) 238 # define RCUTILS_LOG_DEBUG_FUNCTION(function, format, ...) 240 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, format, ...) 242 # define RCUTILS_LOG_DEBUG_SKIPFIRST(format, ...) 244 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, format, ...) 246 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, format, ...) 248 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 250 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 252 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 261 # define RCUTILS_LOG_DEBUG(...) \ 262 RCUTILS_LOG_COND_NAMED( \ 263 RCUTILS_LOG_SEVERITY_DEBUG, \ 264 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 272 # define RCUTILS_LOG_DEBUG_NAMED(name, ...) \ 273 RCUTILS_LOG_COND_NAMED( \ 274 RCUTILS_LOG_SEVERITY_DEBUG, \ 275 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 283 # define RCUTILS_LOG_DEBUG_ONCE(...) \ 284 RCUTILS_LOG_COND_NAMED( \ 285 RCUTILS_LOG_SEVERITY_DEBUG, \ 286 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 295 # define RCUTILS_LOG_DEBUG_ONCE_NAMED(name, ...) \ 296 RCUTILS_LOG_COND_NAMED( \ 297 RCUTILS_LOG_SEVERITY_DEBUG, \ 298 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 307 # define RCUTILS_LOG_DEBUG_EXPRESSION(expression, ...) \ 308 RCUTILS_LOG_COND_NAMED( \ 309 RCUTILS_LOG_SEVERITY_DEBUG, \ 310 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 321 # define RCUTILS_LOG_DEBUG_EXPRESSION_NAMED(expression, name, ...) \ 322 RCUTILS_LOG_COND_NAMED( \ 323 RCUTILS_LOG_SEVERITY_DEBUG, \ 324 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 333 # define RCUTILS_LOG_DEBUG_FUNCTION(function, ...) \ 334 RCUTILS_LOG_COND_NAMED( \ 335 RCUTILS_LOG_SEVERITY_DEBUG, \ 336 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 347 # define RCUTILS_LOG_DEBUG_FUNCTION_NAMED(function, name, ...) \ 348 RCUTILS_LOG_COND_NAMED( \ 349 RCUTILS_LOG_SEVERITY_DEBUG, \ 350 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 358 # define RCUTILS_LOG_DEBUG_SKIPFIRST(...) \ 359 RCUTILS_LOG_COND_NAMED( \ 360 RCUTILS_LOG_SEVERITY_DEBUG, \ 361 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 370 # define RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED(name, ...) \ 371 RCUTILS_LOG_COND_NAMED( \ 372 RCUTILS_LOG_SEVERITY_DEBUG, \ 373 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 383 # define RCUTILS_LOG_DEBUG_THROTTLE(time_source_type, duration, ...) \ 384 RCUTILS_LOG_COND_NAMED( \ 385 RCUTILS_LOG_SEVERITY_DEBUG, \ 386 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 397 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 398 RCUTILS_LOG_COND_NAMED( \ 399 RCUTILS_LOG_SEVERITY_DEBUG, \ 400 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 411 # define RCUTILS_LOG_DEBUG_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 412 RCUTILS_LOG_COND_NAMED( \ 413 RCUTILS_LOG_SEVERITY_DEBUG, \ 414 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 426 # define RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 427 RCUTILS_LOG_COND_NAMED( \ 428 RCUTILS_LOG_SEVERITY_DEBUG, \ 429 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, \ 436 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_INFO) 440 # define RCUTILS_LOG_INFO(format, ...) 441 # define RCUTILS_LOG_INFO_NAMED(name, format, ...) 443 # define RCUTILS_LOG_INFO_ONCE(format, ...) 445 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, format, ...) 447 # define RCUTILS_LOG_INFO_EXPRESSION(expression, format, ...) 449 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, format, ...) 451 # define RCUTILS_LOG_INFO_FUNCTION(function, format, ...) 453 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, format, ...) 455 # define RCUTILS_LOG_INFO_SKIPFIRST(format, ...) 457 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, format, ...) 459 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, format, ...) 461 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 463 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 465 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 474 # define RCUTILS_LOG_INFO(...) \ 475 RCUTILS_LOG_COND_NAMED( \ 476 RCUTILS_LOG_SEVERITY_INFO, \ 477 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 485 # define RCUTILS_LOG_INFO_NAMED(name, ...) \ 486 RCUTILS_LOG_COND_NAMED( \ 487 RCUTILS_LOG_SEVERITY_INFO, \ 488 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 496 # define RCUTILS_LOG_INFO_ONCE(...) \ 497 RCUTILS_LOG_COND_NAMED( \ 498 RCUTILS_LOG_SEVERITY_INFO, \ 499 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 508 # define RCUTILS_LOG_INFO_ONCE_NAMED(name, ...) \ 509 RCUTILS_LOG_COND_NAMED( \ 510 RCUTILS_LOG_SEVERITY_INFO, \ 511 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 520 # define RCUTILS_LOG_INFO_EXPRESSION(expression, ...) \ 521 RCUTILS_LOG_COND_NAMED( \ 522 RCUTILS_LOG_SEVERITY_INFO, \ 523 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 534 # define RCUTILS_LOG_INFO_EXPRESSION_NAMED(expression, name, ...) \ 535 RCUTILS_LOG_COND_NAMED( \ 536 RCUTILS_LOG_SEVERITY_INFO, \ 537 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 546 # define RCUTILS_LOG_INFO_FUNCTION(function, ...) \ 547 RCUTILS_LOG_COND_NAMED( \ 548 RCUTILS_LOG_SEVERITY_INFO, \ 549 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 560 # define RCUTILS_LOG_INFO_FUNCTION_NAMED(function, name, ...) \ 561 RCUTILS_LOG_COND_NAMED( \ 562 RCUTILS_LOG_SEVERITY_INFO, \ 563 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 571 # define RCUTILS_LOG_INFO_SKIPFIRST(...) \ 572 RCUTILS_LOG_COND_NAMED( \ 573 RCUTILS_LOG_SEVERITY_INFO, \ 574 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 583 # define RCUTILS_LOG_INFO_SKIPFIRST_NAMED(name, ...) \ 584 RCUTILS_LOG_COND_NAMED( \ 585 RCUTILS_LOG_SEVERITY_INFO, \ 586 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 596 # define RCUTILS_LOG_INFO_THROTTLE(time_source_type, duration, ...) \ 597 RCUTILS_LOG_COND_NAMED( \ 598 RCUTILS_LOG_SEVERITY_INFO, \ 599 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 610 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 611 RCUTILS_LOG_COND_NAMED( \ 612 RCUTILS_LOG_SEVERITY_INFO, \ 613 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 624 # define RCUTILS_LOG_INFO_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 625 RCUTILS_LOG_COND_NAMED( \ 626 RCUTILS_LOG_SEVERITY_INFO, \ 627 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 639 # define RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 640 RCUTILS_LOG_COND_NAMED( \ 641 RCUTILS_LOG_SEVERITY_INFO, \ 642 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, \ 649 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_WARN) 653 # define RCUTILS_LOG_WARN(format, ...) 654 # define RCUTILS_LOG_WARN_NAMED(name, format, ...) 656 # define RCUTILS_LOG_WARN_ONCE(format, ...) 658 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, format, ...) 660 # define RCUTILS_LOG_WARN_EXPRESSION(expression, format, ...) 662 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, format, ...) 664 # define RCUTILS_LOG_WARN_FUNCTION(function, format, ...) 666 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, format, ...) 668 # define RCUTILS_LOG_WARN_SKIPFIRST(format, ...) 670 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, format, ...) 672 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, format, ...) 674 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 676 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 678 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 687 # define RCUTILS_LOG_WARN(...) \ 688 RCUTILS_LOG_COND_NAMED( \ 689 RCUTILS_LOG_SEVERITY_WARN, \ 690 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 698 # define RCUTILS_LOG_WARN_NAMED(name, ...) \ 699 RCUTILS_LOG_COND_NAMED( \ 700 RCUTILS_LOG_SEVERITY_WARN, \ 701 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 709 # define RCUTILS_LOG_WARN_ONCE(...) \ 710 RCUTILS_LOG_COND_NAMED( \ 711 RCUTILS_LOG_SEVERITY_WARN, \ 712 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 721 # define RCUTILS_LOG_WARN_ONCE_NAMED(name, ...) \ 722 RCUTILS_LOG_COND_NAMED( \ 723 RCUTILS_LOG_SEVERITY_WARN, \ 724 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 733 # define RCUTILS_LOG_WARN_EXPRESSION(expression, ...) \ 734 RCUTILS_LOG_COND_NAMED( \ 735 RCUTILS_LOG_SEVERITY_WARN, \ 736 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 747 # define RCUTILS_LOG_WARN_EXPRESSION_NAMED(expression, name, ...) \ 748 RCUTILS_LOG_COND_NAMED( \ 749 RCUTILS_LOG_SEVERITY_WARN, \ 750 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 759 # define RCUTILS_LOG_WARN_FUNCTION(function, ...) \ 760 RCUTILS_LOG_COND_NAMED( \ 761 RCUTILS_LOG_SEVERITY_WARN, \ 762 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 773 # define RCUTILS_LOG_WARN_FUNCTION_NAMED(function, name, ...) \ 774 RCUTILS_LOG_COND_NAMED( \ 775 RCUTILS_LOG_SEVERITY_WARN, \ 776 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 784 # define RCUTILS_LOG_WARN_SKIPFIRST(...) \ 785 RCUTILS_LOG_COND_NAMED( \ 786 RCUTILS_LOG_SEVERITY_WARN, \ 787 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 796 # define RCUTILS_LOG_WARN_SKIPFIRST_NAMED(name, ...) \ 797 RCUTILS_LOG_COND_NAMED( \ 798 RCUTILS_LOG_SEVERITY_WARN, \ 799 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 809 # define RCUTILS_LOG_WARN_THROTTLE(time_source_type, duration, ...) \ 810 RCUTILS_LOG_COND_NAMED( \ 811 RCUTILS_LOG_SEVERITY_WARN, \ 812 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 823 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 824 RCUTILS_LOG_COND_NAMED( \ 825 RCUTILS_LOG_SEVERITY_WARN, \ 826 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 837 # define RCUTILS_LOG_WARN_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 838 RCUTILS_LOG_COND_NAMED( \ 839 RCUTILS_LOG_SEVERITY_WARN, \ 840 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 852 # define RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 853 RCUTILS_LOG_COND_NAMED( \ 854 RCUTILS_LOG_SEVERITY_WARN, \ 855 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, \ 862 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_ERROR) 866 # define RCUTILS_LOG_ERROR(format, ...) 867 # define RCUTILS_LOG_ERROR_NAMED(name, format, ...) 869 # define RCUTILS_LOG_ERROR_ONCE(format, ...) 871 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, format, ...) 873 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, format, ...) 875 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, format, ...) 877 # define RCUTILS_LOG_ERROR_FUNCTION(function, format, ...) 879 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, format, ...) 881 # define RCUTILS_LOG_ERROR_SKIPFIRST(format, ...) 883 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, format, ...) 885 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, format, ...) 887 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 889 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 891 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 900 # define RCUTILS_LOG_ERROR(...) \ 901 RCUTILS_LOG_COND_NAMED( \ 902 RCUTILS_LOG_SEVERITY_ERROR, \ 903 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 911 # define RCUTILS_LOG_ERROR_NAMED(name, ...) \ 912 RCUTILS_LOG_COND_NAMED( \ 913 RCUTILS_LOG_SEVERITY_ERROR, \ 914 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 922 # define RCUTILS_LOG_ERROR_ONCE(...) \ 923 RCUTILS_LOG_COND_NAMED( \ 924 RCUTILS_LOG_SEVERITY_ERROR, \ 925 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 934 # define RCUTILS_LOG_ERROR_ONCE_NAMED(name, ...) \ 935 RCUTILS_LOG_COND_NAMED( \ 936 RCUTILS_LOG_SEVERITY_ERROR, \ 937 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 946 # define RCUTILS_LOG_ERROR_EXPRESSION(expression, ...) \ 947 RCUTILS_LOG_COND_NAMED( \ 948 RCUTILS_LOG_SEVERITY_ERROR, \ 949 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 960 # define RCUTILS_LOG_ERROR_EXPRESSION_NAMED(expression, name, ...) \ 961 RCUTILS_LOG_COND_NAMED( \ 962 RCUTILS_LOG_SEVERITY_ERROR, \ 963 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 972 # define RCUTILS_LOG_ERROR_FUNCTION(function, ...) \ 973 RCUTILS_LOG_COND_NAMED( \ 974 RCUTILS_LOG_SEVERITY_ERROR, \ 975 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 986 # define RCUTILS_LOG_ERROR_FUNCTION_NAMED(function, name, ...) \ 987 RCUTILS_LOG_COND_NAMED( \ 988 RCUTILS_LOG_SEVERITY_ERROR, \ 989 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 997 # define RCUTILS_LOG_ERROR_SKIPFIRST(...) \ 998 RCUTILS_LOG_COND_NAMED( \ 999 RCUTILS_LOG_SEVERITY_ERROR, \ 1000 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1009 # define RCUTILS_LOG_ERROR_SKIPFIRST_NAMED(name, ...) \ 1010 RCUTILS_LOG_COND_NAMED( \ 1011 RCUTILS_LOG_SEVERITY_ERROR, \ 1012 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1022 # define RCUTILS_LOG_ERROR_THROTTLE(time_source_type, duration, ...) \ 1023 RCUTILS_LOG_COND_NAMED( \ 1024 RCUTILS_LOG_SEVERITY_ERROR, \ 1025 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 1036 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1037 RCUTILS_LOG_COND_NAMED( \ 1038 RCUTILS_LOG_SEVERITY_ERROR, \ 1039 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1050 # define RCUTILS_LOG_ERROR_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1051 RCUTILS_LOG_COND_NAMED( \ 1052 RCUTILS_LOG_SEVERITY_ERROR, \ 1053 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1065 # define RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1066 RCUTILS_LOG_COND_NAMED( \ 1067 RCUTILS_LOG_SEVERITY_ERROR, \ 1068 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, \ 1075 #if (RCUTILS_LOG_MIN_SEVERITY > RCUTILS_LOG_SEVERITY_FATAL) 1079 # define RCUTILS_LOG_FATAL(format, ...) 1080 # define RCUTILS_LOG_FATAL_NAMED(name, format, ...) 1082 # define RCUTILS_LOG_FATAL_ONCE(format, ...) 1084 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, format, ...) 1086 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, format, ...) 1088 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, format, ...) 1090 # define RCUTILS_LOG_FATAL_FUNCTION(function, format, ...) 1092 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, format, ...) 1094 # define RCUTILS_LOG_FATAL_SKIPFIRST(format, ...) 1096 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, format, ...) 1098 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, format, ...) 1100 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, format, ...) 1102 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1104 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, format, ...) 1113 # define RCUTILS_LOG_FATAL(...) \ 1114 RCUTILS_LOG_COND_NAMED( \ 1115 RCUTILS_LOG_SEVERITY_FATAL, \ 1116 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, "", \ 1124 # define RCUTILS_LOG_FATAL_NAMED(name, ...) \ 1125 RCUTILS_LOG_COND_NAMED( \ 1126 RCUTILS_LOG_SEVERITY_FATAL, \ 1127 RCUTILS_LOG_CONDITION_EMPTY, RCUTILS_LOG_CONDITION_EMPTY, name, \ 1135 # define RCUTILS_LOG_FATAL_ONCE(...) \ 1136 RCUTILS_LOG_COND_NAMED( \ 1137 RCUTILS_LOG_SEVERITY_FATAL, \ 1138 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, "", \ 1147 # define RCUTILS_LOG_FATAL_ONCE_NAMED(name, ...) \ 1148 RCUTILS_LOG_COND_NAMED( \ 1149 RCUTILS_LOG_SEVERITY_FATAL, \ 1150 RCUTILS_LOG_CONDITION_ONCE_BEFORE, RCUTILS_LOG_CONDITION_ONCE_AFTER, name, \ 1159 # define RCUTILS_LOG_FATAL_EXPRESSION(expression, ...) \ 1160 RCUTILS_LOG_COND_NAMED( \ 1161 RCUTILS_LOG_SEVERITY_FATAL, \ 1162 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, "", \ 1173 # define RCUTILS_LOG_FATAL_EXPRESSION_NAMED(expression, name, ...) \ 1174 RCUTILS_LOG_COND_NAMED( \ 1175 RCUTILS_LOG_SEVERITY_FATAL, \ 1176 RCUTILS_LOG_CONDITION_EXPRESSION_BEFORE(expression), RCUTILS_LOG_CONDITION_EXPRESSION_AFTER, name, \ 1185 # define RCUTILS_LOG_FATAL_FUNCTION(function, ...) \ 1186 RCUTILS_LOG_COND_NAMED( \ 1187 RCUTILS_LOG_SEVERITY_FATAL, \ 1188 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, "", \ 1199 # define RCUTILS_LOG_FATAL_FUNCTION_NAMED(function, name, ...) \ 1200 RCUTILS_LOG_COND_NAMED( \ 1201 RCUTILS_LOG_SEVERITY_FATAL, \ 1202 RCUTILS_LOG_CONDITION_FUNCTION_BEFORE(function), RCUTILS_LOG_CONDITION_FUNCTION_AFTER, name, \ 1210 # define RCUTILS_LOG_FATAL_SKIPFIRST(...) \ 1211 RCUTILS_LOG_COND_NAMED( \ 1212 RCUTILS_LOG_SEVERITY_FATAL, \ 1213 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1222 # define RCUTILS_LOG_FATAL_SKIPFIRST_NAMED(name, ...) \ 1223 RCUTILS_LOG_COND_NAMED( \ 1224 RCUTILS_LOG_SEVERITY_FATAL, \ 1225 RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, name, \ 1235 # define RCUTILS_LOG_FATAL_THROTTLE(time_source_type, duration, ...) \ 1236 RCUTILS_LOG_COND_NAMED( \ 1237 RCUTILS_LOG_SEVERITY_FATAL, \ 1238 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, "", \ 1249 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE(time_source_type, duration, ...) \ 1250 RCUTILS_LOG_COND_NAMED( \ 1251 RCUTILS_LOG_SEVERITY_FATAL, \ 1252 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration) RCUTILS_LOG_CONDITION_SKIPFIRST_BEFORE, RCUTILS_LOG_CONDITION_THROTTLE_AFTER RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER, "", \ 1263 # define RCUTILS_LOG_FATAL_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1264 RCUTILS_LOG_COND_NAMED( \ 1265 RCUTILS_LOG_SEVERITY_FATAL, \ 1266 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(time_source_type, duration), RCUTILS_LOG_CONDITION_THROTTLE_AFTER, name, \ 1278 # define RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED(time_source_type, duration, name, ...) \ 1279 RCUTILS_LOG_COND_NAMED( \ 1280 RCUTILS_LOG_SEVERITY_FATAL, \ 1281 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, \ 1290 #endif // RCUTILS__LOGGING_MACROS_H_ bool(* RclLogFilter)()
Definition: logging_macros.h:152