-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record all topics #30
Changes from all commits
01947ca
c4098b2
2351161
9b1eb50
c48c545
363cc67
9f7701e
9cb06da
8ffae59
0eb18eb
2a6c423
f1a173b
7d77905
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2018, Bosch Software Innovations GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSBAG2__LOGGING_HPP_ | ||
#define ROSBAG2__LOGGING_HPP_ | ||
|
||
#include <sstream> | ||
#include <string> | ||
|
||
#include "rcutils/logging_macros.h" | ||
|
||
#define ROSBAG2_PACKAGE_NAME "rosbag2" | ||
|
||
#define ROSBAG2_LOG_INFO(...) \ | ||
RCUTILS_LOG_INFO_NAMED(ROSBAG2_PACKAGE_NAME, __VA_ARGS__) | ||
|
||
#define ROSBAG2_LOG_INFO_STREAM(args) do { \ | ||
std::stringstream __ss; \ | ||
__ss << args; \ | ||
RCUTILS_LOG_INFO_NAMED(ROSBAG2_PACKAGE_NAME, __ss.str().c_str()); \ | ||
} while (0) | ||
|
||
#define ROSBAG2_LOG_ERROR(...) \ | ||
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_PACKAGE_NAME, __VA_ARGS__) | ||
|
||
#define ROSBAG2_LOG_ERROR_STREAM(args) do { \ | ||
std::stringstream __ss; \ | ||
__ss << args; \ | ||
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_PACKAGE_NAME, __ss.str().c_str()); \ | ||
} while (0) | ||
|
||
#define ROSBAG2_LOG_WARN(...) \ | ||
RCUTILS_LOG_WARN_NAMED(ROSBAG2_PACKAGE_NAME, __VA_ARGS__) | ||
|
||
#define ROSBAG2_LOG_WARN_STREAM(args) do { \ | ||
std::stringstream __ss; \ | ||
__ss << args; \ | ||
RCUTILS_LOG_WARN_NAMED(ROSBAG2_PACKAGE_NAME, __ss.str().c_str()); \ | ||
} while (0) | ||
|
||
#define ROSBAG2_LOG_DEBUG(...) \ | ||
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_PACKAGE_NAME, __VA_ARGS__) | ||
|
||
#define ROSBAG2_LOG_DEBUG_STREAM(args) do { \ | ||
std::stringstream __ss; \ | ||
__ss << args; \ | ||
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_PACKAGE_NAME, __ss.str().c_str()); \ | ||
} while (0) | ||
|
||
#endif // ROSBAG2__LOGGING_HPP_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ | |
#include "rclcpp/any_subscription_callback.hpp" | ||
#include "rclcpp/subscription.hpp" | ||
|
||
#include "rosbag2/logging.hpp" | ||
|
||
namespace rosbag2 | ||
{ | ||
|
||
|
@@ -98,9 +100,8 @@ GenericSubscription::borrow_serialized_message(size_t capacity) | |
auto fini_return = rmw_serialized_message_fini(msg); | ||
delete msg; | ||
if (fini_return != RCL_RET_OK) { | ||
RCUTILS_LOG_ERROR_NAMED( | ||
"rosbag2", | ||
"failed to destroy serialized message: %s", rcl_get_error_string_safe()); | ||
ROSBAG2_LOG_ERROR_STREAM( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is still a problem with the allocator IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had a close look and I believe it should be ok as is. The content of the allocator gets copied inside We did a check by prematurely destroying the allocator (create That said, I'd love to have a better way to do it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true. Please ignore my comment then. |
||
"Failed to destroy serialized message: " << rcl_get_error_string_safe()); | ||
} | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the need for this file? Is there something in rcutils which is missing?