{"action":"created","issue":{"url":"https://api.github.com/repos/pkg/errors/issues/10","repository_url":"https://api.github.com/repos/pkg/errors","labels_url":"https://api.github.com/repos/pkg/errors/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/pkg/errors/issues/10/comments","events_url":"https://api.github.com/repos/pkg/errors/issues/10/events","html_url":"https://github.com/pkg/errors/issues/10","id":150951370,"number":10,"title":"feature: Location(err)string ","user":{"login":"rand99","id":460223,"avatar_url":"https://avatars.githubusercontent.com/u/460223?v=3","gravatar_id":"","url":"https://api.github.com/users/rand99","html_url":"https://github.com/rand99","followers_url":"https://api.github.com/users/rand99/followers","following_url":"https://api.github.com/users/rand99/following{/other_user}","gists_url":"https://api.github.com/users/rand99/gists{/gist_id}","starred_url":"https://api.github.com/users/rand99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rand99/subscriptions","organizations_url":"https://api.github.com/users/rand99/orgs","repos_url":"https://api.github.com/users/rand99/repos","events_url":"https://api.github.com/users/rand99/events{/privacy}","received_events_url":"https://api.github.com/users/rand99/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-25T18:58:29Z","updated_at":"2016-04-26T01:23:40Z","closed_at":"2016-04-25T21:58:42Z","body":"really nice project! \r\nI only miss one thing while using logrus\r\n\r\n```go\r\n\tlog.WithFields(logrus.Fields{\r\n\t\t\"code\": \"HandlerCheckBla\",\r\n\t\t\"user_id\": user_id,\r\n\t\t\"last_check\": last_check,\r\n                 \"err_location\":  errors.Location(err),   // <-------\r\n\t}).Error(err)\r\n```\r\n\r\ncould you please add something like ...\r\n\r\n```go\r\nfunc Location( err error) string  {\r\n\tstr := \"\"\r\n\tfor err != nil {\r\n\t\tlocation, ok := err.(locationer)\r\n\t\tif ok {\r\n\t\t\tfile, line := location.Location()\r\n\t\t\tstr += fmt.Sprintf(\"%s:%d: \\n\", file, line)\r\n\t\t}\r\n\t\tcause, ok := err.(causer)\r\n\t\tif !ok {\r\n\t\t\treturn str\r\n\t\t\tbreak\r\n\t\t}\r\n\t\terr = cause.Cause()\r\n\t}\r\n\treturn \"\"\r\n #}\r\n```\r\n\r\nto errors.go ... ? 👍 "},"comment":{"url":"https://api.github.com/repos/pkg/errors/issues/comments/214579698","html_url":"https://github.com/pkg/errors/issues/10#issuecomment-214579698","issue_url":"https://api.github.com/repos/pkg/errors/issues/10","id":214579698,"user":{"login":"davecheney","id":7171,"avatar_url":"https://avatars.githubusercontent.com/u/7171?v=3","gravatar_id":"","url":"https://api.github.com/users/davecheney","html_url":"https://github.com/davecheney","followers_url":"https://api.github.com/users/davecheney/followers","following_url":"https://api.github.com/users/davecheney/following{/other_user}","gists_url":"https://api.github.com/users/davecheney/gists{/gist_id}","starred_url":"https://api.github.com/users/davecheney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecheney/subscriptions","organizations_url":"https://api.github.com/users/davecheney/orgs","repos_url":"https://api.github.com/users/davecheney/repos","events_url":"https://api.github.com/users/davecheney/events{/privacy}","received_events_url":"https://api.github.com/users/davecheney/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T01:23:40Z","updated_at":"2016-04-26T01:23:40Z","body":"Don't forget errors.Fprint which will print a formatted stack of errors to an io.Writer"}}