{"action":"created","issue":{"url":"https://api.github.com/repos/araddon/gou/issues/16","repository_url":"https://api.github.com/repos/araddon/gou","labels_url":"https://api.github.com/repos/araddon/gou/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/araddon/gou/issues/16/comments","events_url":"https://api.github.com/repos/araddon/gou/issues/16/events","html_url":"https://github.com/araddon/gou/pull/16","id":136573349,"number":16,"title":"gou logger now counts the number of throttled log messages for a log key","user":{"login":"Ropes","id":489062,"avatar_url":"https://avatars.githubusercontent.com/u/489062?v=3","gravatar_id":"","url":"https://api.github.com/users/Ropes","html_url":"https://github.com/Ropes","followers_url":"https://api.github.com/users/Ropes/followers","following_url":"https://api.github.com/users/Ropes/following{/other_user}","gists_url":"https://api.github.com/users/Ropes/gists{/gist_id}","starred_url":"https://api.github.com/users/Ropes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ropes/subscriptions","organizations_url":"https://api.github.com/users/Ropes/orgs","repos_url":"https://api.github.com/users/Ropes/repos","events_url":"https://api.github.com/users/Ropes/events{/privacy}","received_events_url":"https://api.github.com/users/Ropes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-26T02:03:44Z","updated_at":"2016-02-26T15:48:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/araddon/gou/pulls/16","html_url":"https://github.com/araddon/gou/pull/16","diff_url":"https://github.com/araddon/gou/pull/16.diff","patch_url":"https://github.com/araddon/gou/pull/16.patch"},"body":"The throttled count is stored on the Throttle struct which is associated\r\nvia the global log throttle map. When the throttled messages are allowed\r\nto log the count of messages which were hidden is prefixed to the\r\nmessage.\r\n\r\n`TestThrottler2` showcases the throttled logging output:\r\n```\r\n=== RUN   TestThrottler2\r\n2016/02/25 17:53:48.158830 throttle_test.go:57: hello 0\r\n2016/02/25 17:53:48.158842 throttle_test.go:57: hello 1\r\n2016/02/25 17:53:48.158846 throttle_test.go:57: hello 2\r\n2016/02/25 17:53:48.158850 throttle_test.go:57: hello 3\r\n2016/02/25 17:53:48.158854 throttle_test.go:57: hello 4\r\n2016/02/25 17:53:48.158857 throttle_test.go:57: hello 5\r\n2016/02/25 17:53:48.158861 throttle_test.go:57: hello 6\r\n2016/02/25 17:53:48.158865 throttle_test.go:57: hello 7\r\n2016/02/25 17:53:48.158869 throttle_test.go:57: hello 8\r\n2016/02/25 17:53:48.158873 throttle_test.go:57: hello 9\r\n2016/02/25 17:53:49.159057 throttle_test.go:70: LogsThrottled[10] hello again 20\r\n--- PASS: TestThrottler2 (1.00s)\r\n```\r\n\r\nFirst then logs are written normally, once the throttle is breached the next log message displays the count of messages which were throttled.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/araddon/gou/issues/comments/189332899","html_url":"https://github.com/araddon/gou/pull/16#issuecomment-189332899","issue_url":"https://api.github.com/repos/araddon/gou/issues/16","id":189332899,"user":{"login":"araddon","id":7269,"avatar_url":"https://avatars.githubusercontent.com/u/7269?v=3","gravatar_id":"","url":"https://api.github.com/users/araddon","html_url":"https://github.com/araddon","followers_url":"https://api.github.com/users/araddon/followers","following_url":"https://api.github.com/users/araddon/following{/other_user}","gists_url":"https://api.github.com/users/araddon/gists{/gist_id}","starred_url":"https://api.github.com/users/araddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/araddon/subscriptions","organizations_url":"https://api.github.com/users/araddon/orgs","repos_url":"https://api.github.com/users/araddon/repos","events_url":"https://api.github.com/users/araddon/events{/privacy}","received_events_url":"https://api.github.com/users/araddon/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T15:48:35Z","updated_at":"2016-02-26T15:48:35Z","body":"I would prefer not putting the \"LogThrottled [x]\" at the front of the message, sometimes the prefix of log-message is meaningful, lets put it at end?"}}