{"comment":{"created_at":"2011-10-12T11:29:42Z","body":"Alright, I'm all done. I've put in a pull request.","updated_at":"2011-10-12T11:29:42Z","url":"https://api.github.com/repos/codewarrior0/pymclevel/issues/comments/2378146","id":2378146,"user":{"avatar_url":"https://secure.gravatar.com/avatar/4c6799eb893ae72f8ddddc53dbed504e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/hetmankp","id":728670,"login":"hetmankp"}},"action":"created","issue":{"number":53,"created_at":"2011-10-06T11:38:49Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"At present, pymclevel sends all its log messages to the root logger. This makes it impossible to isolate the pymclevel specific messages in order to control them (well aside from monkey-patching the logging module so it is picked up when pymclevel is loaded... but this is unholy).\r\n\r\nI think the convention is to simply use the __name__ builtin to create a hierarchical naming convention for loggers in all the modules. This way all pymclevel logs messages are still controllable from a single logger specific to pymclevel.\r\n\r\n\r\nSo instead of this:\r\n\r\n    from logging import warn, error, info, debug\r\n    ...\r\n    info(\"blah blah\")\r\n\r\n\r\nIt's possible to do this:\r\n\r\n    import logging\r\n    log = logging.getLogger(__name__)\r\n    ...\r\n    log.info(\"blah blah\")\r\n\r\n\r\nWith this scheme, any code importing pymclevel will be able to get a hold of its logger using: logging.getLogger(\"pymclevel\"). Also any existing code using pymclevel will remain unaffected as all these logs still propagate to the root logger.\r\n\r\n\r\nIf this is a reasonable change request I'm happy to help out with the code change.","comments":10,"title":"Feature request: Isolated logging","updated_at":"2011-10-12T11:29:43Z","url":"https://api.github.com/repos/codewarrior0/pymclevel/issues/53","id":1832962,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/4c6799eb893ae72f8ddddc53dbed504e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/hetmankp","id":728670,"login":"hetmankp"},"html_url":"https://github.com/codewarrior0/pymclevel/issues/53","labels":[],"state":"open"},"legacy":{"issue_id":1832962,"comment_id":2378146}}