{"action":"created","issue":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/8087","repository_url":"https://api.github.com/repos/RobotLocomotion/drake","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/8087/labels{/name}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/8087/comments","events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/8087/events","html_url":"https://github.com/RobotLocomotion/drake/pull/8087","id":297666177,"number":8087,"title":"Provide macros for trace/debug logging that don't evaluate arguments","user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars1.githubusercontent.com/u/4088016?v=4","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jwnimmer-tri","id":17596505,"avatar_url":"https://avatars3.githubusercontent.com/u/17596505?v=4","gravatar_id":"","url":"https://api.github.com/users/jwnimmer-tri","html_url":"https://github.com/jwnimmer-tri","followers_url":"https://api.github.com/users/jwnimmer-tri/followers","following_url":"https://api.github.com/users/jwnimmer-tri/following{/other_user}","gists_url":"https://api.github.com/users/jwnimmer-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/jwnimmer-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwnimmer-tri/subscriptions","organizations_url":"https://api.github.com/users/jwnimmer-tri/orgs","repos_url":"https://api.github.com/users/jwnimmer-tri/repos","events_url":"https://api.github.com/users/jwnimmer-tri/events{/privacy}","received_events_url":"https://api.github.com/users/jwnimmer-tri/received_events","type":"User","site_admin":false},"assignees":[{"login":"jwnimmer-tri","id":17596505,"avatar_url":"https://avatars3.githubusercontent.com/u/17596505?v=4","gravatar_id":"","url":"https://api.github.com/users/jwnimmer-tri","html_url":"https://github.com/jwnimmer-tri","followers_url":"https://api.github.com/users/jwnimmer-tri/followers","following_url":"https://api.github.com/users/jwnimmer-tri/following{/other_user}","gists_url":"https://api.github.com/users/jwnimmer-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/jwnimmer-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwnimmer-tri/subscriptions","organizations_url":"https://api.github.com/users/jwnimmer-tri/orgs","repos_url":"https://api.github.com/users/jwnimmer-tri/repos","events_url":"https://api.github.com/users/jwnimmer-tri/events{/privacy}","received_events_url":"https://api.github.com/users/jwnimmer-tri/received_events","type":"User","site_admin":false},{"login":"SeanCurtis-TRI","id":22159799,"avatar_url":"https://avatars3.githubusercontent.com/u/22159799?v=4","gravatar_id":"","url":"https://api.github.com/users/SeanCurtis-TRI","html_url":"https://github.com/SeanCurtis-TRI","followers_url":"https://api.github.com/users/SeanCurtis-TRI/followers","following_url":"https://api.github.com/users/SeanCurtis-TRI/following{/other_user}","gists_url":"https://api.github.com/users/SeanCurtis-TRI/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanCurtis-TRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanCurtis-TRI/subscriptions","organizations_url":"https://api.github.com/users/SeanCurtis-TRI/orgs","repos_url":"https://api.github.com/users/SeanCurtis-TRI/repos","events_url":"https://api.github.com/users/SeanCurtis-TRI/events{/privacy}","received_events_url":"https://api.github.com/users/SeanCurtis-TRI/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-02-16T02:36:29Z","updated_at":"2018-02-16T15:09:08Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/8087","html_url":"https://github.com/RobotLocomotion/drake/pull/8087","diff_url":"https://github.com/RobotLocomotion/drake/pull/8087.diff","patch_url":"https://github.com/RobotLocomotion/drake/pull/8087.patch"},"body":"Our awesome logging tool spdlog provides macros SPDLOG_TRACE and SPDLOG_DEBUG so we can include tracing and debugging output at zero cost when NDEBUG is defined (typically in Release builds). In case NDEBUG is _undefined_ (meaning assertions etc. are enabled), these macros are expanded and evaluate their arguments _regardless_ of whether trace or debug logging is actually enabled. If the arguments are expensive to evaluate, and the macros are present in performance-sensitive inner loops, this can be painfully slow.\r\n\r\nThis PR adds alternative macros DRAKE_SPDLOG_TRACE and DRAKE_SPDLOG_DEBUG that:\r\n- evaporate if NDEBUG is defined, otherwise\r\n- check the log level before evaluating their arguments.\r\n\r\n(See [discussion](https://reviewable.io/reviews/robotlocomotion/drake/8050#-L5MNznTPOK9IWnKrGmw) in review of #8050.)\r\n\r\nProbably this should be how the original macros behave. I filed [an issue](https://github.com/gabime/spdlog/issues/638) at spdlog.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/robotlocomotion/drake/8087)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments/366261117","html_url":"https://github.com/RobotLocomotion/drake/pull/8087#issuecomment-366261117","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/8087","id":366261117,"user":{"login":"SeanCurtis-TRI","id":22159799,"avatar_url":"https://avatars3.githubusercontent.com/u/22159799?v=4","gravatar_id":"","url":"https://api.github.com/users/SeanCurtis-TRI","html_url":"https://github.com/SeanCurtis-TRI","followers_url":"https://api.github.com/users/SeanCurtis-TRI/followers","following_url":"https://api.github.com/users/SeanCurtis-TRI/following{/other_user}","gists_url":"https://api.github.com/users/SeanCurtis-TRI/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanCurtis-TRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanCurtis-TRI/subscriptions","organizations_url":"https://api.github.com/users/SeanCurtis-TRI/orgs","repos_url":"https://api.github.com/users/SeanCurtis-TRI/repos","events_url":"https://api.github.com/users/SeanCurtis-TRI/events{/privacy}","received_events_url":"https://api.github.com/users/SeanCurtis-TRI/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T15:09:08Z","updated_at":"2018-02-16T15:09:08Z","author_association":"CONTRIBUTOR","body":"<img class=\"emoji\" title=\":LGTM:\" alt=\":LGTM:\" align=\"absmiddle\" src=\"https://reviewable.io/lgtm.png\" height=\"20\" width=\"61\"/> This makes perfect sense to me.\n\n---\n\nReviewed 2 of 2 files at r1.\nReview status: all files reviewed at latest revision, 1 unresolved discussion.\n\n---\n\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/robotlocomotion/drake/8087#-:-L5U9JB08-3aV3wFSO53:b-5eact8)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"SeanCurtis-TRI"}}