Conversation
Can't stop the log calls from being called, so handle it gracefully
This reverts commit 182b133.
It was the absence of a name; we don't prepend it to other names.
|
Latest CI including ros2/rclpy#130: |
|
this is ready for another round of review @ros2/team. everything in my previous summary is still valid (scope, points potentially up for discussion) |
| [RCUTILS_LOG_SEVERITY_WARN] = "WARN", | ||
| [RCUTILS_LOG_SEVERITY_ERROR] = "ERROR", | ||
| [RCUTILS_LOG_SEVERITY_FATAL] = "FATAL", | ||
| }; |
There was a problem hiding this comment.
How are the other entries initialized?
There was a problem hiding this comment.
automatically as null, there's a check for null after retrieving the values at: https://github.com/ros2/rcutils/pull/57/files/ab249daaef9556c9aa2a2b79bc0ccb4a98829b61#diff-f909d0b1a298531f76132943dc55f86aR190
src/logging.c
Outdated
| { | ||
| g_rcutils_logging_output_handler = function; | ||
| RCUTILS_LOGGING_AUTOINIT | ||
| g_rcutils_logging_output_handler = function; |
There was a problem hiding this comment.
Indentation seems to be off?
Same below.
There was a problem hiding this comment.
yeah this is what uncrustify wanted: I'll disable what's making it complain
I allowed them to be independent as an arbitrary decision but equating them is needed to facilitate an empty-named root logger concept in wrappers
|
Ready for review. What's changed since the last summary is that now the empty-named logger acts as if it's the root logger: changing the severity threshold for the empty-named logger changes the default severity. This was done in order to facilitate an empty root logger in ros2/rclpy#132 (comment). The default logger's severity is still stored as a global variable, instead of in the severity map, to facilitate global configuration even when the severity map can't be used for some reason. |
|
@ros2/team if anyone has an idea for how I can help this be easier to review I'm open to suggestions. If it would help someone, I can provide descriptions, discussions, or break it into several PRs that build on top of each other. |
| * \param[in] delimiter the character to search for | ||
| * \returns the index of the first occurence of the delimiter if found, or | ||
| * \returns `string_length` if the delimiter is not found, or | ||
| * \returns `0` for invalid arguments |
There was a problem hiding this comment.
What if the delimiter is at index 0? How do you know the difference between that and invalid arguments?
There was a problem hiding this comment.
Same question for findn version.
There was a problem hiding this comment.
@clalancette also raised this question in #57 (comment); the conclusion was that it will be addressed as followup #58
| * \param[in] delimiter the character to search for | ||
| * \returns the index of the last occurence of the delimiter if found, or | ||
| * \returns `string_length` if the delimiter is not found, or | ||
| * \returns `0` for invalid arguments |
There was a problem hiding this comment.
Same question, what if delimiter is at 0 only.
include/rcutils/logging.h
Outdated
| * \param name The name of the logger, must be null terminated c string or NULL. | ||
| * \param severity The severity level. | ||
| * | ||
| * \return True if the logger is enabled for the severity; false otherwise. |
There was a problem hiding this comment.
nitpick: True is uppercase and false is lower, lower is correct in C++
There was a problem hiding this comment.
thanks, I was capitalising the sentence. fixed in 3024667
| if (!rcutils_allocator_is_valid(&allocator)) { | ||
| fprintf( | ||
| stderr, | ||
| "Provided allocator is invalid. Using the default allocator.\n"); |
There was a problem hiding this comment.
Since you're returning an error code should you use RCUTILS_SET_ERROR_MSG?
|
@wjwwood could you please review the recent changes regarding your suggestion to use
|
|
I've moved the commits related to This is CI for the approved changes here and the approved ros2/rclpy#132. I'll merge. |
still in progressdescription below.