{"action":"created","issue":{"url":"https://api.github.com/repos/Sirupsen/logrus/issues/249","labels_url":"https://api.github.com/repos/Sirupsen/logrus/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/Sirupsen/logrus/issues/249/comments","events_url":"https://api.github.com/repos/Sirupsen/logrus/issues/249/events","html_url":"https://github.com/Sirupsen/logrus/pull/249","id":105460382,"number":249,"title":"Golf Support","user":{"login":"akutz","id":101085,"avatar_url":"https://avatars.githubusercontent.com/u/101085?v=3","gravatar_id":"","url":"https://api.github.com/users/akutz","html_url":"https://github.com/akutz","followers_url":"https://api.github.com/users/akutz/followers","following_url":"https://api.github.com/users/akutz/following{/other_user}","gists_url":"https://api.github.com/users/akutz/gists{/gist_id}","starred_url":"https://api.github.com/users/akutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akutz/subscriptions","organizations_url":"https://api.github.com/users/akutz/orgs","repos_url":"https://api.github.com/users/akutz/repos","events_url":"https://api.github.com/users/akutz/events{/privacy}","received_events_url":"https://api.github.com/users/akutz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-08T20:14:22Z","updated_at":"2015-09-08T22:45:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Sirupsen/logrus/pulls/249","html_url":"https://github.com/Sirupsen/logrus/pull/249","diff_url":"https://github.com/Sirupsen/logrus/pull/249.diff","patch_url":"https://github.com/Sirupsen/logrus/pull/249.patch"},"body":"This patch adds support for the Golf package, a library that enables\r\ntypes to define the fields they want returned about themselves or by way\r\nof reflection.\r\n\r\nFor example, take the following type:\r\n\r\n    type Person struct {\r\n        Name  string\r\n        Alias string\r\n    }\r\n\r\n    p := &Person{\"Bruce\", \"Batman\"}\r\n\r\nIf p were given to Logrus as a field value with an associated key of\r\n\"hero\" then it would be formatted as such (given a text formatter):\r\n\r\n    hero=\"&{Bruce Batman}\"\r\n\r\nHowever, the Person type may know how it wants to be formatted when it\r\ncomes to be logged as a field value, and this interface will provide\r\nthat advantage.\r\n\r\n    func (p *Person) PlayGolf() bool {\r\n        return true\r\n    }\r\n\r\nNow when a Person instance is provided to Logrus as a field value with\r\nan associated key of hero it would be formatted as such (given a text\r\nformatter):\r\n\r\n    hero.Name=Bruce hero.Alias=Batman...\r\n\r\nFor more information on how the Golf package works, please see\r\nhttps://github.com/akutz/golf. Thank you!"},"comment":{"url":"https://api.github.com/repos/Sirupsen/logrus/issues/comments/138724462","html_url":"https://github.com/Sirupsen/logrus/pull/249#issuecomment-138724462","issue_url":"https://api.github.com/repos/Sirupsen/logrus/issues/249","id":138724462,"user":{"login":"akutz","id":101085,"avatar_url":"https://avatars.githubusercontent.com/u/101085?v=3","gravatar_id":"","url":"https://api.github.com/users/akutz","html_url":"https://github.com/akutz","followers_url":"https://api.github.com/users/akutz/followers","following_url":"https://api.github.com/users/akutz/following{/other_user}","gists_url":"https://api.github.com/users/akutz/gists{/gist_id}","starred_url":"https://api.github.com/users/akutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akutz/subscriptions","organizations_url":"https://api.github.com/users/akutz/orgs","repos_url":"https://api.github.com/users/akutz/repos","events_url":"https://api.github.com/users/akutz/events{/privacy}","received_events_url":"https://api.github.com/users/akutz/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T22:45:54Z","updated_at":"2015-09-08T22:45:54Z","body":"Hi @aybabtme,\r\n\r\nThat's a really good point. i could create Text and JSON formatters with Golf support and let users decide whether or not to use those. Good idea. I still think there is value in including it by default, but at the very minimum your suggestion will allow it to exist in conjunction with the official release sooner than later."}}