{"action":"created","issue":{"url":"https://api.github.com/repos/borntyping/python-colorlog/issues/32","repository_url":"https://api.github.com/repos/borntyping/python-colorlog","labels_url":"https://api.github.com/repos/borntyping/python-colorlog/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/borntyping/python-colorlog/issues/32/comments","events_url":"https://api.github.com/repos/borntyping/python-colorlog/issues/32/events","html_url":"https://github.com/borntyping/python-colorlog/pull/32","id":156114184,"number":32,"title":"Add support for per-loglevel formatting","user":{"login":"mdraw","id":6719909,"avatar_url":"https://avatars.githubusercontent.com/u/6719909?v=3","gravatar_id":"","url":"https://api.github.com/users/mdraw","html_url":"https://github.com/mdraw","followers_url":"https://api.github.com/users/mdraw/followers","following_url":"https://api.github.com/users/mdraw/following{/other_user}","gists_url":"https://api.github.com/users/mdraw/gists{/gist_id}","starred_url":"https://api.github.com/users/mdraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdraw/subscriptions","organizations_url":"https://api.github.com/users/mdraw/orgs","repos_url":"https://api.github.com/users/mdraw/repos","events_url":"https://api.github.com/users/mdraw/events{/privacy}","received_events_url":"https://api.github.com/users/mdraw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-21T18:00:54Z","updated_at":"2016-05-24T12:41:07Z","closed_at":"2016-05-24T12:34:22Z","pull_request":{"url":"https://api.github.com/repos/borntyping/python-colorlog/pulls/32","html_url":"https://github.com/borntyping/python-colorlog/pull/32","diff_url":"https://github.com/borntyping/python-colorlog/pull/32.diff","patch_url":"https://github.com/borntyping/python-colorlog/pull/32.patch"},"body":"This makes it possible to specify a formatter dictionary that enables colorlog to format messages differently based on their log level.\r\n\r\nUse case:\r\n- If you want to log informational output using `logger.info()`, you are rarely interested in the module and line number where the message comes from.\r\n- On the other hand, it can be useful to prefix warnings, errors and criticals with 'WARNING: ' etc. and add line number and module at the end, for example.\r\n\r\nThis is why I added the `level_fmts` argument to ColoredFormatter.\r\n\r\nI tested the new code with Python 2.7 and Python 3.5.\r\n\r\nPossible issues:\r\n- `default_level_formats` has nothing to do with colorlog's normal `default_formats`. Could this be confusing?\r\n- We could reuse the `fmt` argument instead of introducing the new `level_fmts`. We would need to check if `fmt` is a dict or a string in `ColoredFormatter.__init__()` and could use it differently depending on the type. I don't know if that would be better. What is your opinion?"},"comment":{"url":"https://api.github.com/repos/borntyping/python-colorlog/issues/comments/221256232","html_url":"https://github.com/borntyping/python-colorlog/pull/32#issuecomment-221256232","issue_url":"https://api.github.com/repos/borntyping/python-colorlog/issues/32","id":221256232,"user":{"login":"mdraw","id":6719909,"avatar_url":"https://avatars.githubusercontent.com/u/6719909?v=3","gravatar_id":"","url":"https://api.github.com/users/mdraw","html_url":"https://github.com/mdraw","followers_url":"https://api.github.com/users/mdraw/followers","following_url":"https://api.github.com/users/mdraw/following{/other_user}","gists_url":"https://api.github.com/users/mdraw/gists{/gist_id}","starred_url":"https://api.github.com/users/mdraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdraw/subscriptions","organizations_url":"https://api.github.com/users/mdraw/orgs","repos_url":"https://api.github.com/users/mdraw/repos","events_url":"https://api.github.com/users/mdraw/events{/privacy}","received_events_url":"https://api.github.com/users/mdraw/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T12:41:07Z","updated_at":"2016-05-24T12:41:07Z","body":"Thanks a lot for merging this!\r\nI'd like to remind you to update https://github.com/borntyping/python-colorlog/blob/master/colorlog/colorlog.py#L158 before tagging a new relea"}}
{"actor":{"display_login":"mdraw"}}