{"action":"created","issue":{"url":"https://api.github.com/repos/gabime/spdlog/issues/235","repository_url":"https://api.github.com/repos/gabime/spdlog","labels_url":"https://api.github.com/repos/gabime/spdlog/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/gabime/spdlog/issues/235/comments","events_url":"https://api.github.com/repos/gabime/spdlog/issues/235/events","html_url":"https://github.com/gabime/spdlog/issues/235","id":163146207,"number":235,"title":"Is it possible to log source file name, called function and line number where logging occurs?","user":{"login":"pmalek","id":739996,"avatar_url":"https://avatars.githubusercontent.com/u/739996?v=3","gravatar_id":"","url":"https://api.github.com/users/pmalek","html_url":"https://github.com/pmalek","followers_url":"https://api.github.com/users/pmalek/followers","following_url":"https://api.github.com/users/pmalek/following{/other_user}","gists_url":"https://api.github.com/users/pmalek/gists{/gist_id}","starred_url":"https://api.github.com/users/pmalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmalek/subscriptions","organizations_url":"https://api.github.com/users/pmalek/orgs","repos_url":"https://api.github.com/users/pmalek/repos","events_url":"https://api.github.com/users/pmalek/events{/privacy}","received_events_url":"https://api.github.com/users/pmalek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-30T11:48:38Z","updated_at":"2016-06-30T14:33:21Z","closed_at":null,"body":"I am wondering whether it is possible source file name, called function and line number where logging occurs.\r\n\r\nSomething like:\r\n\r\n```\r\n2016-06-20 11:00:02 main.cpp:20 MyClass::MyClass() log message\r\n```\r\n\r\nIs it possible? "},"comment":{"url":"https://api.github.com/repos/gabime/spdlog/issues/comments/229676640","html_url":"https://github.com/gabime/spdlog/issues/235#issuecomment-229676640","issue_url":"https://api.github.com/repos/gabime/spdlog/issues/235","id":229676640,"user":{"login":"pmalek","id":739996,"avatar_url":"https://avatars.githubusercontent.com/u/739996?v=3","gravatar_id":"","url":"https://api.github.com/users/pmalek","html_url":"https://github.com/pmalek","followers_url":"https://api.github.com/users/pmalek/followers","following_url":"https://api.github.com/users/pmalek/following{/other_user}","gists_url":"https://api.github.com/users/pmalek/gists{/gist_id}","starred_url":"https://api.github.com/users/pmalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmalek/subscriptions","organizations_url":"https://api.github.com/users/pmalek/orgs","repos_url":"https://api.github.com/users/pmalek/repos","events_url":"https://api.github.com/users/pmalek/events{/privacy}","received_events_url":"https://api.github.com/users/pmalek/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T14:33:21Z","updated_at":"2016-06-30T14:33:21Z","body":"I have managed to write something like this\r\n\r\n\r\n```cpp\r\n#define SPDLOG_DEBUG(logger, ...) \\\r\n  { \\\r\n  std::string s; \\\r\n  s.reserve(64); \\\r\n  s.append(__FILE__); \\\r\n  s.append(\"#\"); \\\r\n  s.append(std::to_string(__LINE__)); \\\r\n  s.append(\": \"); \\\r\n  logger->debug(s + __VA_ARGS__); \\\r\n  } \\\r\n```\r\n\r\nbut this only works for regular strings without any formatting argument because of obvious reasons."}}
{"actor":{"display_login":"pmalek"}}