{"action":"created","issue":{"url":"https://api.github.com/repos/shadow/shadow/issues/315","repository_url":"https://api.github.com/repos/shadow/shadow","labels_url":"https://api.github.com/repos/shadow/shadow/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/shadow/shadow/issues/315/comments","events_url":"https://api.github.com/repos/shadow/shadow/issues/315/events","html_url":"https://github.com/shadow/shadow/issues/315","id":172082213,"number":315,"title":"unable to use c++ logging libraries google's glog or boost's logging","user":{"login":"cauthu","id":1170852,"avatar_url":"https://avatars.githubusercontent.com/u/1170852?v=3","gravatar_id":"","url":"https://api.github.com/users/cauthu","html_url":"https://github.com/cauthu","followers_url":"https://api.github.com/users/cauthu/followers","following_url":"https://api.github.com/users/cauthu/following{/other_user}","gists_url":"https://api.github.com/users/cauthu/gists{/gist_id}","starred_url":"https://api.github.com/users/cauthu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cauthu/subscriptions","organizations_url":"https://api.github.com/users/cauthu/orgs","repos_url":"https://api.github.com/users/cauthu/repos","events_url":"https://api.github.com/users/cauthu/events{/privacy}","received_events_url":"https://api.github.com/users/cauthu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-19T08:40:23Z","updated_at":"2016-09-07T20:50:31Z","closed_at":null,"body":"Hi Rob,\r\n\r\nConsider this simple test plugin `test.cpp` that tries to use google `glog` library [1]:\r\n```\r\n#include <glog/logging.h>\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    google::InitGoogleLogging(argv[0]);\r\n    LOG(ERROR) << \"glog statement!\";\r\n    return 0;\r\n}\r\n```\r\nIf I run a simulation with only one node (modified from `hello`'s example, with server commented out), I can see the log message:\r\n```\r\nme@utu1604vm ~/shadow-plugin-extras/test > cat shadow.data/hosts/helloclient/stderr-hello-1000.log \r\nE0101 00:00:20.000000  5804 test.cpp:6] glog statement!\r\nme@utu1604vm ~/shadow-plugin-extras/test > \r\n```\r\nBut when I run both nodes, then the server node, which starts first, logs the message no problem:\r\n```\r\nme@utu1604vm ~/shadow-plugin-extras/test > cat shadow.data/hosts/helloserver/stderr-hello-1000.log \r\nE0101 00:00:10.000000  5811 test.cpp:6] glog statement!\r\nme@utu1604vm ~/shadow-plugin-extras/test > \r\n```\r\n... but then the client node runs into problem:\r\n```\r\nme@utu1604vm ~/shadow-plugin-extras/test > head -3 shadow.data/hosts/helloclient/stderr-hello-1000.log \r\nF0101 00:00:20.000000  5811 utilities.cc:320] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!\r\n*** Check failure stack trace: ***\r\n    @     0x7f84ac20a5cd  google::LogMessage::Fail()\r\nme@utu1604vm ~/shadow-plugin-extras/test > \r\n```\r\nAny help appreciated! Thanks!\r\n\r\n   * OS: Ubuntu 16.04.1 (on a VM)\r\n   * `shadow` revision: 9609e8552cc1e3479bffab701a403a6fd896186d (Thu Aug 4 11:30:09 2016)\r\n   * `shadow-plugin-extras` revision: e857ed6ad946ce50bc5b50a4600081fbd26826f0 (Fri Aug 12 18:49:16 2016)\r\n   * plugin `CMakeLists.txt`:\r\n```\r\ncmake_minimum_required (VERSION 2.8.8 FATAL_ERROR)\r\nproject(shadow-plugin-test CXX)\r\nadd_shadow_plugin(shadow-plugin-test test.cpp)\r\ntarget_link_libraries(shadow-plugin-test \"-lglog\")\r\ninstall(TARGETS shadow-plugin-test DESTINATION plugins)\r\n```\r\n[1] https://github.com/google/glog (on Ubuntu `apt-get install libgoogle-glog-dev`)\r\n"},"comment":{"url":"https://api.github.com/repos/shadow/shadow/issues/comments/245414649","html_url":"https://github.com/shadow/shadow/issues/315#issuecomment-245414649","issue_url":"https://api.github.com/repos/shadow/shadow/issues/315","id":245414649,"user":{"login":"cauthu","id":1170852,"avatar_url":"https://avatars.githubusercontent.com/u/1170852?v=3","gravatar_id":"","url":"https://api.github.com/users/cauthu","html_url":"https://github.com/cauthu","followers_url":"https://api.github.com/users/cauthu/followers","following_url":"https://api.github.com/users/cauthu/following{/other_user}","gists_url":"https://api.github.com/users/cauthu/gists{/gist_id}","starred_url":"https://api.github.com/users/cauthu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cauthu/subscriptions","organizations_url":"https://api.github.com/users/cauthu/orgs","repos_url":"https://api.github.com/users/cauthu/repos","events_url":"https://api.github.com/users/cauthu/events{/privacy}","received_events_url":"https://api.github.com/users/cauthu/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T20:50:31Z","updated_at":"2016-09-07T20:50:31Z","body":"> Glad you got it working. I wonder if the easyloggingpp initialization issue is related to #320?\r\n\r\nI suspect as much."}}
{"actor":{"display_login":"cauthu"}}