Skip to content

Commit

Permalink
Exceptions submodule, fix logging
Browse files Browse the repository at this point in the history
Follows from #21
  • Loading branch information
vmayoral committed Mar 5, 2019
1 parent 06c07e0 commit 7138f30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions moveit_core/exceptions/src/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
#include <rcutils/logging_macros.h>
#include "rclcpp/rclcpp.hpp"

#define ROS_ERROR RCUTILS_LOG_ERROR
// Logger
rclcpp::Logger logger_exceptions = rclcpp::get_logger("exceptions");

moveit::ConstructException::ConstructException(const std::string& what_arg) : std::runtime_error(what_arg)
{
ROS_ERROR("Error during construction of object: %s\nException thrown.", what_arg.c_str());
RCLCPP_ERROR(logger_exceptions, "Error during construction of object: %s\nException thrown.", what_arg.c_str());
}

moveit::Exception::Exception(const std::string& what_arg) : std::runtime_error(what_arg)
{
ROS_ERROR("Exception thrown.", what_arg.c_str());
RCLCPP_ERROR(logger_exceptions, "Exception thrown.", what_arg.c_str());
}

0 comments on commit 7138f30

Please sign in to comment.