{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/demos/pulls/comments/154233849","pull_request_review_id":80367835,"id":154233849,"diff_hunk":"@@ -0,0 +1,72 @@\n+// Copyright 2016 Open Source Robotics Foundation, Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+#include \"logging_demo/logger_config_component.hpp\"\n+\n+#include <cinttypes>\n+#include <iostream>\n+#include <memory>\n+\n+#include \"logging_demo/srv/config_logger.hpp\"\n+#include \"rclcpp/rclcpp.hpp\"\n+\n+namespace logging_demo\n+{\n+\n+LoggerConfig::LoggerConfig()\n+: Node(\"logger_config\")\n+{\n+  auto handle_logger_config_req =\n+    [this](\n+    const std::shared_ptr<logging_demo::srv::ConfigLogger::Request> request,\n+    std::shared_ptr<logging_demo::srv::ConfigLogger::Response> response\n+    ) -> void\n+    {\n+      const char * severity_string = request->severity_threshold.c_str();\n+      RCLCPP_INFO(\n+        this->get_name(), \"Incoming request: logger '%s', severity '%s'\",\n+        request->logger_name.c_str(), severity_string);\n+      std::flush(std::cout);\n+      int severity;\n+      if (strcmp(\"DEBUG\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_DEBUG;\n+      } else if (strcmp(\"INFO\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_INFO;\n+      } else if (strcmp(\"WARN\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_WARN;\n+      } else if (strcmp(\"ERROR\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_ERROR;\n+      } else if (strcmp(\"FATAL\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_FATAL;\n+      } else if (strcmp(\"UNSET\", severity_string) == 0) {\n+        severity = RCUTILS_LOG_SEVERITY_UNSET;\n+      } else {\n+        RCLCPP_ERROR(\n+          this->get_name(), \"Unknown severity '%s'\", severity_string);\n+        response->success = false;\n+        return;\n+      }\n+\n+      rcutils_logging_set_logger_severity_threshold(request->logger_name.c_str(), severity);","path":"logging_demo/src/logger_config_component.cpp","position":61,"original_position":61,"commit_id":"f939305673cdbcb4d0dd4439f4e0bf4c4d41c15e","original_commit_id":"f939305673cdbcb4d0dd4439f4e0bf4c4d41c15e","user":{"login":"dhood","id":5618076,"avatar_url":"https://avatars0.githubusercontent.com/u/5618076?v=4","gravatar_id":"","url":"https://api.github.com/users/dhood","html_url":"https://github.com/dhood","followers_url":"https://api.github.com/users/dhood/followers","following_url":"https://api.github.com/users/dhood/following{/other_user}","gists_url":"https://api.github.com/users/dhood/gists{/gist_id}","starred_url":"https://api.github.com/users/dhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhood/subscriptions","organizations_url":"https://api.github.com/users/dhood/orgs","repos_url":"https://api.github.com/users/dhood/repos","events_url":"https://api.github.com/users/dhood/events{/privacy}","received_events_url":"https://api.github.com/users/dhood/received_events","type":"User","site_admin":false},"body":"seems like a good idea thanks! didn't know that's what RCUTILS_WARN_UNUSED was for.. will look into it.","created_at":"2017-11-30T23:41:37Z","updated_at":"2017-11-30T23:41:37Z","html_url":"https://github.com/ros2/demos/pull/194#discussion_r154233849","pull_request_url":"https://api.github.com/repos/ros2/demos/pulls/194","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ros2/demos/pulls/comments/154233849"},"html":{"href":"https://github.com/ros2/demos/pull/194#discussion_r154233849"},"pull_request":{"href":"https://api.github.com/repos/ros2/demos/pulls/194"}},"in_reply_to_id":154172896},"pull_request":{"url":"https://api.github.com/repos/ros2/demos/pulls/194","id":154272680,"html_url":"https://github.com/ros2/demos/pull/194","diff_url":"https://github.com/ros2/demos/pull/194.diff","patch_url":"https://github.com/ros2/demos/pull/194.patch","issue_url":"https://api.github.com/repos/ros2/demos/issues/194","number":194,"state":"open","locked":false,"title":"Add demo for logging + logger config","user":{"login":"dhood","id":5618076,"avatar_url":"https://avatars0.githubusercontent.com/u/5618076?v=4","gravatar_id":"","url":"https://api.github.com/users/dhood","html_url":"https://github.com/dhood","followers_url":"https://api.github.com/users/dhood/followers","following_url":"https://api.github.com/users/dhood/following{/other_user}","gists_url":"https://api.github.com/users/dhood/gists{/gist_id}","starred_url":"https://api.github.com/users/dhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhood/subscriptions","organizations_url":"https://api.github.com/users/dhood/orgs","repos_url":"https://api.github.com/users/dhood/repos","events_url":"https://api.github.com/users/dhood/events{/privacy}","received_events_url":"https://api.github.com/users/dhood/received_events","type":"User","site_admin":false},"body":"Usage:\r\n```\r\n# start node with logging calls and node that accept logger config service requests\r\n$ ros2 run logging_demo logging_demo_main\r\n```\r\n\r\n```\r\n# configure logger to debug\r\n$ ros2 service call /config_logger logging_demo/ConfigLogger \"{logger_name: 'logger_usage_demo', severity_threshold: DEBUG}\"\r\n```\r\n\r\nThe LoggerConfig component can be dropped into a running (composition-api-based) system to get config access to the loggers of the process","created_at":"2017-11-22T23:03:55Z","updated_at":"2017-11-30T23:41:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47724aa0d202f8fc75805f4471eb119f60e9ef2b","assignee":{"login":"dhood","id":5618076,"avatar_url":"https://avatars0.githubusercontent.com/u/5618076?v=4","gravatar_id":"","url":"https://api.github.com/users/dhood","html_url":"https://github.com/dhood","followers_url":"https://api.github.com/users/dhood/followers","following_url":"https://api.github.com/users/dhood/following{/other_user}","gists_url":"https://api.github.com/users/dhood/gists{/gist_id}","starred_url":"https://api.github.com/users/dhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhood/subscriptions","organizations_url":"https://api.github.com/users/dhood/orgs","repos_url":"https://api.github.com/users/dhood/repos","events_url":"https://api.github.com/users/dhood/events{/privacy}","received_events_url":"https://api.github.com/users/dhood/received_events","type":"User","site_admin":false},"assignees":[{"login":"dhood","id":5618076,"avatar_url":"https://avatars0.githubusercontent.com/u/5618076?v=4","gravatar_id":"","url":"https://api.github.com/users/dhood","html_url":"https://github.com/dhood","followers_url":"https://api.github.com/users/dhood/followers","following_url":"https://api.github.com/users/dhood/following{/other_user}","gists_url":"https://api.github.com/users/dhood/gists{/gist_id}","starred_url":"https://api.github.com/users/dhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhood/subscriptions","organizations_url":"https://api.github.com/users/dhood/orgs","repos_url":"https://api.github.com/users/dhood/repos","events_url":"https://api.github.com/users/dhood/events{/privacy}","received_events_url":"https://api.github.com/users/dhood/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ros2/demos/pulls/194/commits","review_comments_url":"https://api.github.com/repos/ros2/demos/pulls/194/comments","review_comment_url":"https://api.github.com/repos/ros2/demos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/demos/issues/194/comments","statuses_url":"https://api.github.com/repos/ros2/demos/statuses/f939305673cdbcb4d0dd4439f4e0bf4c4d41c15e","head":{"label":"ros2:logging_config_demo","ref":"logging_config_demo","sha":"f939305673cdbcb4d0dd4439f4e0bf4c4d41c15e","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":39266291,"name":"demos","full_name":"ros2/demos","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/demos","description":null,"fork":false,"url":"https://api.github.com/repos/ros2/demos","forks_url":"https://api.github.com/repos/ros2/demos/forks","keys_url":"https://api.github.com/repos/ros2/demos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/demos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/demos/teams","hooks_url":"https://api.github.com/repos/ros2/demos/hooks","issue_events_url":"https://api.github.com/repos/ros2/demos/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/demos/events","assignees_url":"https://api.github.com/repos/ros2/demos/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/demos/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/demos/tags","blobs_url":"https://api.github.com/repos/ros2/demos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/demos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/demos/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/demos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/demos/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/demos/languages","stargazers_url":"https://api.github.com/repos/ros2/demos/stargazers","contributors_url":"https://api.github.com/repos/ros2/demos/contributors","subscribers_url":"https://api.github.com/repos/ros2/demos/subscribers","subscription_url":"https://api.github.com/repos/ros2/demos/subscription","commits_url":"https://api.github.com/repos/ros2/demos/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/demos/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/demos/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/demos/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/demos/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/demos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/demos/merges","archive_url":"https://api.github.com/repos/ros2/demos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/demos/downloads","issues_url":"https://api.github.com/repos/ros2/demos/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/demos/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/demos/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/demos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/demos/labels{/name}","releases_url":"https://api.github.com/repos/ros2/demos/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/demos/deployments","created_at":"2015-07-17T17:24:00Z","updated_at":"2017-11-24T15:20:03Z","pushed_at":"2017-11-30T23:35:36Z","git_url":"git://github.com/ros2/demos.git","ssh_url":"git@github.com:ros2/demos.git","clone_url":"https://github.com/ros2/demos.git","svn_url":"https://github.com/ros2/demos","homepage":null,"size":1474,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":19,"open_issues":8,"watchers":14,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"fbf1fad4eab4ce7f514a4a7fa06ec9e56eb5b479","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":39266291,"name":"demos","full_name":"ros2/demos","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/demos","description":null,"fork":false,"url":"https://api.github.com/repos/ros2/demos","forks_url":"https://api.github.com/repos/ros2/demos/forks","keys_url":"https://api.github.com/repos/ros2/demos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/demos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/demos/teams","hooks_url":"https://api.github.com/repos/ros2/demos/hooks","issue_events_url":"https://api.github.com/repos/ros2/demos/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/demos/events","assignees_url":"https://api.github.com/repos/ros2/demos/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/demos/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/demos/tags","blobs_url":"https://api.github.com/repos/ros2/demos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/demos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/demos/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/demos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/demos/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/demos/languages","stargazers_url":"https://api.github.com/repos/ros2/demos/stargazers","contributors_url":"https://api.github.com/repos/ros2/demos/contributors","subscribers_url":"https://api.github.com/repos/ros2/demos/subscribers","subscription_url":"https://api.github.com/repos/ros2/demos/subscription","commits_url":"https://api.github.com/repos/ros2/demos/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/demos/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/demos/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/demos/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/demos/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/demos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/demos/merges","archive_url":"https://api.github.com/repos/ros2/demos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/demos/downloads","issues_url":"https://api.github.com/repos/ros2/demos/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/demos/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/demos/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/demos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/demos/labels{/name}","releases_url":"https://api.github.com/repos/ros2/demos/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/demos/deployments","created_at":"2015-07-17T17:24:00Z","updated_at":"2017-11-24T15:20:03Z","pushed_at":"2017-11-30T23:35:36Z","git_url":"git://github.com/ros2/demos.git","ssh_url":"git@github.com:ros2/demos.git","clone_url":"https://github.com/ros2/demos.git","svn_url":"https://github.com/ros2/demos","homepage":null,"size":1474,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":19,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/demos/pulls/194"},"html":{"href":"https://github.com/ros2/demos/pull/194"},"issue":{"href":"https://api.github.com/repos/ros2/demos/issues/194"},"comments":{"href":"https://api.github.com/repos/ros2/demos/issues/194/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/demos/pulls/194/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/demos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/demos/pulls/194/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/demos/statuses/f939305673cdbcb4d0dd4439f4e0bf4c4d41c15e"}},"author_association":"OWNER"}}
{"actor":{"display_login":"dhood"}}