{"action":"created","issue":{"url":"https://api.github.com/repos/six8/logaware/issues/2","repository_url":"https://api.github.com/repos/six8/logaware","labels_url":"https://api.github.com/repos/six8/logaware/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/six8/logaware/issues/2/comments","events_url":"https://api.github.com/repos/six8/logaware/issues/2/events","html_url":"https://github.com/six8/logaware/issues/2","id":181287301,"number":2,"title":"Examples to demonstrate how the logger works","user":{"login":"symbolix","id":474655,"avatar_url":"https://avatars.githubusercontent.com/u/474655?v=3","gravatar_id":"","url":"https://api.github.com/users/symbolix","html_url":"https://github.com/symbolix","followers_url":"https://api.github.com/users/symbolix/followers","following_url":"https://api.github.com/users/symbolix/following{/other_user}","gists_url":"https://api.github.com/users/symbolix/gists{/gist_id}","starred_url":"https://api.github.com/users/symbolix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symbolix/subscriptions","organizations_url":"https://api.github.com/users/symbolix/orgs","repos_url":"https://api.github.com/users/symbolix/repos","events_url":"https://api.github.com/users/symbolix/events{/privacy}","received_events_url":"https://api.github.com/users/symbolix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-10-05T23:03:32Z","updated_at":"2016-10-08T09:14:56Z","closed_at":null,"body":"Hi,\r\n\r\nThank you very much for creating this logging module. Could you please help me by providing a simple example regarding the usage of this module? I tried couple of things, however was not able to get it working. A simple case example would be really helpful. (All the `tox` tests are passing by the way and I am on Python 2.7). Thanks."},"comment":{"url":"https://api.github.com/repos/six8/logaware/issues/comments/252413640","html_url":"https://github.com/six8/logaware/issues/2#issuecomment-252413640","issue_url":"https://api.github.com/repos/six8/logaware/issues/2","id":252413640,"user":{"login":"symbolix","id":474655,"avatar_url":"https://avatars.githubusercontent.com/u/474655?v=3","gravatar_id":"","url":"https://api.github.com/users/symbolix","html_url":"https://github.com/symbolix","followers_url":"https://api.github.com/users/symbolix/followers","following_url":"https://api.github.com/users/symbolix/following{/other_user}","gists_url":"https://api.github.com/users/symbolix/gists{/gist_id}","starred_url":"https://api.github.com/users/symbolix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symbolix/subscriptions","organizations_url":"https://api.github.com/users/symbolix/orgs","repos_url":"https://api.github.com/users/symbolix/repos","events_url":"https://api.github.com/users/symbolix/events{/privacy}","received_events_url":"https://api.github.com/users/symbolix/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T09:14:55Z","updated_at":"2016-10-08T09:14:55Z","body":"Just one more thing. Is it possible to have a case where the contextual information actually has an effect on the way the log message is registered? For example a custom logger level `event` that will only generate a log message in case of some arbitrary condition is met.\r\n\r\nLet me explain this with a simple example:\r\n\r\n```python\r\ndef test_condition_info():\r\n\r\n    # Level (1)\r\n    with log_meta_context(current_size=5, size_limit=9): meta_log.event('Limit event has occured.')\r\n```\r\n\r\nThis will produce:\r\n\r\n```\r\n[2016-10-08 10:07:29,807] <__main__> {myApp:test_condition_info:93} (EVENT) Limit event has occured. >> {\"current_size\":5, \"size_limit\":9}\r\n```\r\n\r\n... and the logic is that since `current_size < size_limit` we can see the message. How ever, the following will not register inside the logs:\r\n\r\n```\r\nwith log_meta_context(current_size=11, size_limit=9): meta_log.event('Limit event has occurred.')\r\n```\r\n\r\nConsidering that `current_size` and `size_limit` are dynamic values, this is something I am trying to achieve. I am curious to know if this is possible or is it a feature request?\r\n\r\nThanks."}}
{"actor":{"display_login":"symbolix"}}