{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4967","repository_url":"https://api.github.com/repos/ethereum/cpp-ethereum","labels_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4967/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4967/comments","events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4967/events","html_url":"https://github.com/ethereum/cpp-ethereum/pull/4967","id":315796197,"number":4967,"title":"Refactor logging - libp2p","user":{"login":"gumb0","id":1863135,"avatar_url":"https://avatars0.githubusercontent.com/u/1863135?v=4","gravatar_id":"","url":"https://api.github.com/users/gumb0","html_url":"https://github.com/gumb0","followers_url":"https://api.github.com/users/gumb0/followers","following_url":"https://api.github.com/users/gumb0/following{/other_user}","gists_url":"https://api.github.com/users/gumb0/gists{/gist_id}","starred_url":"https://api.github.com/users/gumb0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gumb0/subscriptions","organizations_url":"https://api.github.com/users/gumb0/orgs","repos_url":"https://api.github.com/users/gumb0/repos","events_url":"https://api.github.com/users/gumb0/events{/privacy}","received_events_url":"https://api.github.com/users/gumb0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-19T09:25:02Z","updated_at":"2018-04-24T08:45:34Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4967","html_url":"https://github.com/ethereum/cpp-ethereum/pull/4967","diff_url":"https://github.com/ethereum/cpp-ethereum/pull/4967.diff","patch_url":"https://github.com/ethereum/cpp-ethereum/pull/4967.patch"},"body":"In general I think it's preferable to use loggers local to the task (say, loggers declared as class members), this way you avoid the overhead of thread-safety needed for global loggers.\r\n\r\nlibp2p though used the number of channels shared among all classes of the library.\r\nFor now I mostly replicated this approach by declaring several global loggers (in `p2p` namespace). Still I simplified it somewhat, reducing the number of loggers (some were merged into one and some I was able to make class members)\r\n\r\nAll libp2p loggers write to `\"net\"` channel (to be able to filter all of them out) and vary by verbosity.\r\n\r\nIt doesn't include node discovery logs from `NodeTable` class, they will still go to another channel I think (in the following PR)"},"comment":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/comments/383853370","html_url":"https://github.com/ethereum/cpp-ethereum/pull/4967#issuecomment-383853370","issue_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4967","id":383853370,"user":{"login":"gumb0","id":1863135,"avatar_url":"https://avatars0.githubusercontent.com/u/1863135?v=4","gravatar_id":"","url":"https://api.github.com/users/gumb0","html_url":"https://github.com/gumb0","followers_url":"https://api.github.com/users/gumb0/followers","following_url":"https://api.github.com/users/gumb0/following{/other_user}","gists_url":"https://api.github.com/users/gumb0/gists{/gist_id}","starred_url":"https://api.github.com/users/gumb0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gumb0/subscriptions","organizations_url":"https://api.github.com/users/gumb0/orgs","repos_url":"https://api.github.com/users/gumb0/repos","events_url":"https://api.github.com/users/gumb0/events{/privacy}","received_events_url":"https://api.github.com/users/gumb0/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T08:45:34Z","updated_at":"2018-04-24T08:45:34Z","author_association":"MEMBER","body":"Rebased"}}
{"actor":{"display_login":"gumb0"}}