@@ -188,6 +188,69 @@ rcl_logging_rosout_output_handler(
188
188
const char * format ,
189
189
va_list * args );
190
190
191
+ /// Add a subordinate logger based on a logger
192
+ /**
193
+ * Calling this will use the existing publisher of `logger_name` on a node to create an subordinate
194
+ * logger that will be used by the logging system to publish all log messages from that Node's
195
+ * logger.
196
+ *
197
+ * If a subordinate logger already exists, it will NOT be created.
198
+ *
199
+ * It is expected that after creating a subordinate logger with this function
200
+ * rcl_logging_rosout_remove_sublogger() will be called for the node to cleanup
201
+ * the subordinate logger while the publisher of `logger_name` is still valid.
202
+ *
203
+ *
204
+ * <hr>
205
+ * Attribute | Adherence
206
+ * ------------------ | -------------
207
+ * Allocates Memory | Yes
208
+ * Thread-Safe | No
209
+ * Uses Atomics | No
210
+ * Lock-Free | Yes
211
+ *
212
+ * \param[in] logger_name a logger_name that has a corresponding rosout publisher on a node
213
+ * \param[in] sublogger_name a sublogger name
214
+ * \return #RCL_RET_OK if the subordinate logger was created successfully, or
215
+ * \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
216
+ * \return #RCL_RET_SUBLOGGER_ALREADY_EXIST if the subordinate logger already exists, or
217
+ * \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
218
+ * \return #RCL_RET_ERROR if an unspecified error occurs.
219
+ */
220
+ RCL_PUBLIC
221
+ RCL_WARN_UNUSED
222
+ rcl_ret_t
223
+ rcl_logging_rosout_add_sublogger (
224
+ const char * logger_name , const char * sublogger_name );
225
+
226
+ /// Remove a subordinate logger and cleans up allocated resources
227
+ /**
228
+ * Calling this will destroy the subordinate logger based on
229
+ * `logger_name+RCUTILS_LOGGING_SEPARATOR_STRING+sublogger_name` on that node and remove it from
230
+ * the logging system so that no more Log messages are published to this function.
231
+ *
232
+ *
233
+ * <hr>
234
+ * Attribute | Adherence
235
+ * ------------------ | -------------
236
+ * Allocates Memory | Yes
237
+ * Thread-Safe | No
238
+ * Uses Atomics | No
239
+ * Lock-Free | Yes
240
+ *
241
+ * \param[in] logger_name a logger_name that has a corresponding rosout publisher on a node
242
+ * \param[in] sublogger_name a sublogger name
243
+ * \return #RCL_RET_OK if the subordinate logger was finalized successfully, or
244
+ * \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
245
+ * \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
246
+ * \return #RCL_RET_ERROR if an unspecified error occurs.
247
+ */
248
+ RCL_PUBLIC
249
+ RCL_WARN_UNUSED
250
+ rcl_ret_t
251
+ rcl_logging_rosout_remove_sublogger (
252
+ const char * logger_name , const char * sublogger_name );
253
+
191
254
#ifdef __cplusplus
192
255
}
193
256
#endif
0 commit comments