{"action":"created","issue":{"url":"https://api.github.com/repos/gabime/spdlog/issues/145","labels_url":"https://api.github.com/repos/gabime/spdlog/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/gabime/spdlog/issues/145/comments","events_url":"https://api.github.com/repos/gabime/spdlog/issues/145/events","html_url":"https://github.com/gabime/spdlog/issues/145","id":116936683,"number":145,"title":"Blocking flush in multithreaded logger","user":{"login":"rob-p","id":361470,"avatar_url":"https://avatars.githubusercontent.com/u/361470?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-p","html_url":"https://github.com/rob-p","followers_url":"https://api.github.com/users/rob-p/followers","following_url":"https://api.github.com/users/rob-p/following{/other_user}","gists_url":"https://api.github.com/users/rob-p/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-p/subscriptions","organizations_url":"https://api.github.com/users/rob-p/orgs","repos_url":"https://api.github.com/users/rob-p/repos","events_url":"https://api.github.com/users/rob-p/events{/privacy}","received_events_url":"https://api.github.com/users/rob-p/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-14T16:38:48Z","updated_at":"2015-11-17T13:37:32Z","closed_at":null,"body":"Hi,\r\n\r\n  First, thanks for spdlog.  It's a fantastic library and has become my go-to tool for logging in all of my projects.  It's lightweight header only nature, fast speed, and rich feature set make it a near-perfect choice!  I have a situation in which I'm using a multi-threaded logger, and I want to report a certain error condition to the user before the program exits.  The problem that I'm encountering is that *sometimes* the message appears and *sometimes* it does not (the program terminates before the message is written).  I'm making the call to flush the logger before I call `std::exit()`.  In the multithreaded logger, is there any way to *block* until the log has been flushed?  Right now, I'm reduced to the very inelegant solution of using `cerr` in the cases where I want to report an error right before program termination."},"comment":{"url":"https://api.github.com/repos/gabime/spdlog/issues/comments/157372333","html_url":"https://github.com/gabime/spdlog/issues/145#issuecomment-157372333","issue_url":"https://api.github.com/repos/gabime/spdlog/issues/145","id":157372333,"user":{"login":"gabime","id":6052198,"avatar_url":"https://avatars.githubusercontent.com/u/6052198?v=3","gravatar_id":"","url":"https://api.github.com/users/gabime","html_url":"https://github.com/gabime","followers_url":"https://api.github.com/users/gabime/followers","following_url":"https://api.github.com/users/gabime/following{/other_user}","gists_url":"https://api.github.com/users/gabime/gists{/gist_id}","starred_url":"https://api.github.com/users/gabime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabime/subscriptions","organizations_url":"https://api.github.com/users/gabime/orgs","repos_url":"https://api.github.com/users/gabime/repos","events_url":"https://api.github.com/users/gabime/events{/privacy}","received_events_url":"https://api.github.com/users/gabime/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T13:37:32Z","updated_at":"2015-11-17T13:37:32Z","body":"This is very strange indeed.. which os/compiler do you use?"}}