19
19
# ifndef RCUTILS__LOGGING_MACROS_H_
20
20
# define RCUTILS__LOGGING_MACROS_H_
21
21
22
+ // * INDENT- OFF*
23
+
22
24
# include "rcutils/logging.h"
23
25
24
26
# include <stdio.h>
@@ -108,7 +110,7 @@ extern "C"
108
110
* A macro finalizing the `once` condition.
109
111
* /
110
112
# define RCUTILS_LOG_CONDITION_ONCE_AFTER } \
111
- }
113
+ }
112
114
/// @@ }
113
115
114
116
/** @ @ name Macros for the ` expression ` condition which ignores the log calls
@@ -169,7 +171,7 @@ typedef bool (* RclLogFilter)();
169
171
* A macro finalizing the ` skipfirst ` condition.
170
172
*/
171
173
# define RCUTILS_LOG_CONDITION_SKIPFIRST_AFTER } \
172
- }
174
+ }
173
175
/// @@}
174
176
175
177
/** @@name Macros for the `throttle` condition which ignores log calls if the
@@ -181,28 +183,28 @@ typedef bool (* RclLogFilter)();
181
183
* A macro initializing and checking the ` throttle ` condition.
182
184
*/
183
185
# define RCUTILS_LOG_CONDITION_THROTTLE_BEFORE(get_time_point_value, duration) { \
184
- static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS (RCUTILS_CAST_DURATION (duration)); \
185
- static rcutils_time_point_value_t __rcutils_logging_last_logged = 0 ; \
186
- rcutils_time_point_value_t __rcutils_logging_now = 0 ; \
187
- bool __rcutils_logging_condition = true ; \
188
- if (get_time_point_value (& __rcutils_logging_now) != RCUTILS_RET_OK) { \
189
- rcutils_log ( \
190
- & __rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, " " , \
191
- " %s() at %s:%d getting current steady time failed\n " , \
192
- __func__, __FILE__, __LINE__); \
193
- } else { \
194
- __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \
195
- } \
186
+ static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS (RCUTILS_CAST_DURATION (duration)); \
187
+ static rcutils_time_point_value_t __rcutils_logging_last_logged = 0 ; \
188
+ rcutils_time_point_value_t __rcutils_logging_now = 0 ; \
189
+ bool __rcutils_logging_condition = true ; \
190
+ if (get_time_point_value (& __rcutils_logging_now) != RCUTILS_RET_OK) { \
191
+ rcutils_log ( \
192
+ & __rcutils_logging_location, RCUTILS_LOG_SEVERITY_ERROR, " " , \
193
+ " %s() at %s:%d getting current steady time failed\n " , \
194
+ __func__, __FILE__, __LINE__); \
195
+ } else { \
196
+ __rcutils_logging_condition = __rcutils_logging_now >= __rcutils_logging_last_logged + __rcutils_logging_duration; \
197
+ } \
196
198
\
197
- if (RCUTILS_LIKELY (__rcutils_logging_condition)) { \
198
- __rcutils_logging_last_logged = __rcutils_logging_now;
199
+ if (RCUTILS_LIKELY (__rcutils_logging_condition)) { \
200
+ __rcutils_logging_last_logged = __rcutils_logging_now;
199
201
200
202
/**
201
203
* \def RCUTILS_LOG_CONDITION_THROTTLE_AFTER
202
204
* A macro finalizing the ` throttle ` condition.
203
205
*/
204
206
# define RCUTILS_LOG_CONDITION_THROTTLE_AFTER } \
205
- }
207
+ }
206
208
/// @@}
207
209
208
210
@{
@@ -257,6 +259,8 @@ from rcutils.logging import severities
257
259
# endif
258
260
/// @@ }
259
261
262
+ // * INDENT- ON*
263
+
260
264
@ [end for ]@
261
265
# ifdef __cplusplus
262
266
}
0 commit comments