{"action":"opened","issue":{"url":"https://api.github.com/repos/ChristopherDavenport/log4cats/issues/3","repository_url":"https://api.github.com/repos/ChristopherDavenport/log4cats","labels_url":"https://api.github.com/repos/ChristopherDavenport/log4cats/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ChristopherDavenport/log4cats/issues/3/comments","events_url":"https://api.github.com/repos/ChristopherDavenport/log4cats/issues/3/events","html_url":"https://github.com/ChristopherDavenport/log4cats/issues/3","id":317578288,"number":3,"title":"Add mean to easily add context information to messages from a given logger","user":{"login":"keirlawson","id":49213,"avatar_url":"https://avatars1.githubusercontent.com/u/49213?v=4","gravatar_id":"","url":"https://api.github.com/users/keirlawson","html_url":"https://github.com/keirlawson","followers_url":"https://api.github.com/users/keirlawson/followers","following_url":"https://api.github.com/users/keirlawson/following{/other_user}","gists_url":"https://api.github.com/users/keirlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/keirlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keirlawson/subscriptions","organizations_url":"https://api.github.com/users/keirlawson/orgs","repos_url":"https://api.github.com/users/keirlawson/repos","events_url":"https://api.github.com/users/keirlawson/events{/privacy}","received_events_url":"https://api.github.com/users/keirlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-25T10:59:09Z","updated_at":"2018-04-25T10:59:09Z","closed_at":null,"author_association":"NONE","body":"We want to have certain values logged every time a log message is emitted from a given logger. In Journal we achieved this using its support for a handler function (`handler: LogMessage => Unit`) thus:\r\n\r\n```scala\r\n    new Logger(\r\n      backend, {\r\n        case journal.Error(message, None) =>\r\n          backend.error(prependContext(message))\r\n        case journal.Error(message, Some(e)) =>\r\n          backend.error(prependContext(message), e)\r\n        case journal.Info(message, None) =>\r\n          backend.info(prependContext(message))\r\n        case journal.Info(message, Some(e)) =>\r\n          backend.info(prependContext(message), e)\r\n        case journal.Warn(message, None) =>\r\n          backend.warn(prependContext(message))\r\n        case journal.Warn(message, Some(e)) =>\r\n          backend.warn(prependContext(message), e)\r\n        case journal.Debug(message, None) =>\r\n          backend.debug(prependContext(message))\r\n        case journal.Debug(message, Some(e)) =>\r\n          backend.debug(prependContext(message), e)\r\n      }\r\n    )\r\n```\r\n\r\nObiously this is a lot of code duplication.\r\n\r\nSo far as I can see to achieve a similar result with log4cats in its current form one would need to create a new log4s logger with a new implementation of the `org.slf4j.Logger` interface that would do the above prepending.  This seems overly cumbersome, it would be great to have some sort of easier way to do this in log4cats."}}
{"actor":{"display_login":"keirlawson"}}