-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
146 additions
and
14 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<library path="lib/libjsk_topic_tools_test"> | ||
<class name="jsk_topic_tools_test/LogUtils" type="LogUtils" | ||
base_class_type="nodelet::Nodelet"> | ||
<description> | ||
Test nodelet for logging macros. | ||
</description> | ||
</class> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include <nodelet/nodelet.h> | ||
#include <pluginlib/class_list_macros.h> | ||
#include <ros/ros.h> | ||
|
||
#include <jsk_topic_tools/log_utils.h> | ||
|
||
namespace jsk_topic_tools | ||
{ | ||
class LogUtils : public nodelet::Nodelet | ||
{ | ||
private: | ||
virtual void onInit() | ||
{ | ||
JSK_NODELET_DEBUG("DEBUG output"); | ||
JSK_NODELET_DEBUG_STREAM("DEBUG" << " output"); | ||
JSK_NODELET_DEBUG_THROTTLE(10.0, "DEBUG output"); | ||
JSK_NODELET_DEBUG_STREAM_THROTTLE(10.0, "DEBUG" << " output"); | ||
|
||
JSK_NODELET_INFO("INFO output"); | ||
JSK_NODELET_INFO_STREAM("INFO" << " output"); | ||
JSK_NODELET_INFO_THROTTLE(10.0, "INFO output"); | ||
JSK_NODELET_INFO_STREAM_THROTTLE(10.0, "INFO" << " output"); | ||
|
||
JSK_NODELET_WARN("WARN output"); | ||
JSK_NODELET_WARN_STREAM("WARN" << " output"); | ||
JSK_NODELET_WARN_THROTTLE(10.0, "WARN output"); | ||
JSK_NODELET_WARN_STREAM_THROTTLE(10.0, "WARN" << " output"); | ||
|
||
JSK_NODELET_ERROR("ERROR output"); | ||
JSK_NODELET_ERROR_STREAM("ERROR" << " output"); | ||
JSK_NODELET_ERROR_THROTTLE(10.0, "ERROR output"); | ||
JSK_NODELET_ERROR_STREAM_THROTTLE(10.0, "ERROR" << " output"); | ||
|
||
JSK_NODELET_FATAL("FATAL output"); | ||
JSK_NODELET_FATAL_STREAM("FATAL" << " output"); | ||
JSK_NODELET_FATAL_THROTTLE(10.0, "FATAL output"); | ||
JSK_NODELET_FATAL_STREAM_THROTTLE(10.0, "FATAL" << " output"); | ||
} | ||
}; | ||
} | ||
|
||
typedef jsk_topic_tools::LogUtils LogUtils; | ||
PLUGINLIB_EXPORT_CLASS(LogUtils, nodelet::Nodelet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* test_nodelet_log.cpp | ||
* Author: Yuki Furuta <[email protected]> | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
#include <nodelet/nodelet.h> | ||
#include <nodelet/loader.h> | ||
#include <ros/ros.h> | ||
#include <string> | ||
#include <vector> | ||
|
||
TEST(JSKNodeletLog, TEST_LOG) | ||
{ | ||
nodelet::Loader n(false); | ||
ros::M_string remappings; | ||
std::string nodelet_name = ros::this_node::getName(); | ||
std::string nodelet_type = "jsk_topic_tools_test/LogUtils"; | ||
std::vector<std::string> argv; | ||
EXPECT_TRUE(n.load(nodelet_name, nodelet_type, remappings, argv)); | ||
} | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
ros::init(argc, argv, "test_nodelet_log_utils"); | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<launch> | ||
<test test-name="nodelet_log_test" pkg="jsk_topic_tools" type="test_nodelet_log" /> | ||
</launch> |