{"comment":{"created_at":"2011-10-10T12:16:39Z","body":"So I have a couple of questions:\r\n\r\n1) Is mce.py always intended to be run stand-alone or will it ever be imported by anyone else? If it's just a command line tool it probably makes sense to leave the root logger alone here. Actually I notice you defined a _log() method but never used it so if there's anything specific you had in mind here let me know.\r\n\r\n2) There's a bug in tests.py on lines 243-246 but I'm not sure of the intention here. Was it going to report the number of total blocks? Should I touch this at all?\r\n\r\nBesides this the change actually looks pretty straightforward so it should be ready to go once I get some feedback.\r\n\r\nCheers.","updated_at":"2011-10-10T12:16:39Z","url":"https://api.github.com/repos/codewarrior0/pymclevel/issues/comments/2346735","id":2346735,"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":3,"title":"Feature request: Isolated logging","updated_at":"2011-10-10T12:16:39Z","url":"https://api.github.com/repos/codewarrior0/pymclevel/issues/53","id":1832962,"assignee":null,"milestone":null,"closed_at":"2011-10-10T12:16:39Z","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":"closed"},"legacy":{"issue_id":1832962,"comment_id":2346735}}