Skip to content

Commit

Permalink
Fix rcl package's logging API error specs and handling. (ros2#746)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored Aug 14, 2020
1 parent ed449a5 commit 6967075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions rcl/include/rcl/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef rcutils_logging_output_handler_t rcl_logging_output_handler_t;
* \return `RCL_RET_OK` if successful, or
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_ERR` if a general error occurs
* \return `RCL_RET_ERROR` if a general error occurs
*/
RCL_PUBLIC
RCL_WARN_UNUSED
Expand All @@ -74,8 +74,9 @@ rcl_logging_configure(
* \param allocator Used to allocate memory used by the logging system
* \param output_handler Output handler to be installed
* \return `RCL_RET_OK` if successful, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
* \return `RCL_RET_ERR` if a general error occurs
* \return `RCL_RET_ERROR` if a general error occurs
*/
RCL_PUBLIC
RCL_WARN_UNUSED
Expand All @@ -97,7 +98,7 @@ rcl_logging_configure_with_output_handler(
* Lock-Free | Yes
*
* \return `RCL_RET_OK` if successful.
* \return `RCL_RET_ERR` if a general error occurs
* \return `RCL_RET_ERROR` if a general error occurs
*/
RCL_PUBLIC
RCL_WARN_UNUSED
Expand Down
3 changes: 2 additions & 1 deletion rcl/src/rcl/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ rcl_logging_configure_with_output_handler(
rcl_logging_output_handler_t output_handler)
{
RCL_CHECK_ARGUMENT_FOR_NULL(global_args, RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(allocator, RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(output_handler, RCL_RET_INVALID_ARGUMENT);
RCUTILS_LOGGING_AUTOINIT
g_logging_allocator = *allocator;
int default_level = -1;
Expand Down

0 comments on commit 6967075

Please sign in to comment.