{"action":"closed","issue":{"url":"https://api.github.com/repos/tornadoweb/tornado/issues/1342","labels_url":"https://api.github.com/repos/tornadoweb/tornado/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/tornadoweb/tornado/issues/1342/comments","events_url":"https://api.github.com/repos/tornadoweb/tornado/issues/1342/events","html_url":"https://github.com/tornadoweb/tornado/issues/1342","id":57928043,"number":1342,"title":"options - parse callbacks don't get OptionParser ","user":{"login":"Paranaix","id":1858546,"avatar_url":"https://avatars.githubusercontent.com/u/1858546?v=3","gravatar_id":"","url":"https://api.github.com/users/Paranaix","html_url":"https://github.com/Paranaix","followers_url":"https://api.github.com/users/Paranaix/followers","following_url":"https://api.github.com/users/Paranaix/following{/other_user}","gists_url":"https://api.github.com/users/Paranaix/gists{/gist_id}","starred_url":"https://api.github.com/users/Paranaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paranaix/subscriptions","organizations_url":"https://api.github.com/users/Paranaix/orgs","repos_url":"https://api.github.com/users/Paranaix/repos","events_url":"https://api.github.com/users/Paranaix/events{/privacy}","received_events_url":"https://api.github.com/users/Paranaix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-17T14:08:45Z","updated_at":"2015-02-18T01:37:15Z","closed_at":"2015-02-18T01:37:15Z","body":"`tornado.log.define_logging_options` doesn't work as intented because `enable_pretty_logging` doesn't get the actual `OptionParser` which triggered the callback and will thus use the default options object even if that didn't invoked the callback.\r\n\r\n    def run_parse_callbacks(self):\r\n        for callback in self._parse_callbacks:\r\n            callback()\r\n\r\nshould be changed to either:\r\n\r\n    callback(self)\r\n\r\nor:\r\n\r\n    callback(options = self)\r\n\r\nand it should be documented, that callbacks receive the `OptionParser` object. \r\n\r\nIf this isn't viable due to whatever reasons, `define_logging_options` should atleast bind the `options` object when adding the callback so that aboves bug is fixed."}}