{"action":"created","issue":{"url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/93","repository_url":"https://api.github.com/repos/kazu-yamamoto/logger","labels_url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/93/comments","events_url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/93/events","html_url":"https://github.com/kazu-yamamoto/logger/issues/93","id":161470972,"number":93,"title":"No-TH logging with GHC8s CallStacks","user":{"login":"alexbiehl","id":1876617,"avatar_url":"https://avatars1.githubusercontent.com/u/1876617?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbiehl","html_url":"https://github.com/alexbiehl","followers_url":"https://api.github.com/users/alexbiehl/followers","following_url":"https://api.github.com/users/alexbiehl/following{/other_user}","gists_url":"https://api.github.com/users/alexbiehl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbiehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbiehl/subscriptions","organizations_url":"https://api.github.com/users/alexbiehl/orgs","repos_url":"https://api.github.com/users/alexbiehl/repos","events_url":"https://api.github.com/users/alexbiehl/events{/privacy}","received_events_url":"https://api.github.com/users/alexbiehl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-21T15:41:05Z","updated_at":"2017-04-24T21:05:26Z","closed_at":null,"body":"Hello, \n\nI've been toying around with GHC 8s CallStack lately. Maybe this is something you are interested in as well! It eliminates the need for template haskell to have precise source location in your logs. \n\nHere, a little example: \n\n``` haskell\nlogWithCS :: (?callstack::CallStack, MonadLogger m, ToLogStr msg) => LogLevel -> msg -> m ()\nlogWithCS level msg =\n  case getCallStack ?callstack of\n    ((_, srcLoc):_)\n      -> monadLoggerLog (Loc { loc_filename = srcLocFile srcLoc\n                             , loc_package  = srcLocPackage srcLoc\n                             , loc_module   = srcLocModule srcLoc\n                             , loc_start    = (srcLocStartLine srcLoc, srcLocStartCol srcLoc)\n                             , loc_end      = (srcLocEndLine srcLoc, srcLocEndCol srcLoc)\n                             } ) \"\" level msg\n```\n\nRunning \n\n``` haskell\nimport Control.Monad.Logger\n\nmain :: IO ()\nmain = do\n\n  runStdoutLoggingT $ do\n    logWithCS LevelInfo \"hello callstack\"\n```\n\nresults in : `[Info] hello callstack @(main:Main main.hs:7:5)`\n"},"comment":{"url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/comments/296822145","html_url":"https://github.com/kazu-yamamoto/logger/issues/93#issuecomment-296822145","issue_url":"https://api.github.com/repos/kazu-yamamoto/logger/issues/93","id":296822145,"user":{"login":"gregwebs","id":1183,"avatar_url":"https://avatars1.githubusercontent.com/u/1183?v=3","gravatar_id":"","url":"https://api.github.com/users/gregwebs","html_url":"https://github.com/gregwebs","followers_url":"https://api.github.com/users/gregwebs/followers","following_url":"https://api.github.com/users/gregwebs/following{/other_user}","gists_url":"https://api.github.com/users/gregwebs/gists{/gist_id}","starred_url":"https://api.github.com/users/gregwebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregwebs/subscriptions","organizations_url":"https://api.github.com/users/gregwebs/orgs","repos_url":"https://api.github.com/users/gregwebs/repos","events_url":"https://api.github.com/users/gregwebs/events{/privacy}","received_events_url":"https://api.github.com/users/gregwebs/received_events","type":"User","site_admin":false},"created_at":"2017-04-24T21:05:26Z","updated_at":"2017-04-24T21:05:26Z","body":"This should be closed now."}}
{"actor":{"display_login":"gregwebs"}}