void OnTerminate() { try { std::rethrow_exception(std::current_exception()); systemLogStream.Event(std::string("Terminate called, shutting down services.")); } catch (Exception& ex) { systemLogStream.Event(std::string("Terminate called, shutting down services.") + ex.what() + "\n" + ex.StackTraceStr()); } catch (std::exception& ex) { systemLogStream.Event(std::string("Terminate called, shutting down services.") + ex.what()); } logger.Flush(); logger.OpenStream(nullptr); logFile.close(); int ans = MessageBoxA(NULL, "Open logs?", "Unhandled exception", MB_YESNO); if (ans == IDYES) { system(logFilePath.string().c_str()); } std::abort(); }
void FilePath::Pimpl::set(const std::experimental::filesystem::path& pPath) { path = pPath; name = pPath.string(); }
static std::string ToString(const FS::path& path) { auto pathString = path.string(); std::replace(pathString.begin(), pathString.end(), '\\', '/'); return pathString; }