1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-02 17:06:41 +00:00

Merge branch 'osg_stats_file_error' into 'master'

Log error when failed to open stats file

See merge request OpenMW/openmw!2690
This commit is contained in:
psi29a 2023-02-06 23:41:31 +00:00
commit d22d3a9ea4

View file

@ -1,6 +1,8 @@
#include "engine.hpp" #include "engine.hpp"
#include <cerrno>
#include <chrono> #include <chrono>
#include <system_error>
#include <thread> #include <thread>
#include <osgDB/WriteFile> #include <osgDB/WriteFile>
@ -870,9 +872,10 @@ void OMW::Engine::go()
{ {
stats.open(path, std::ios_base::out); stats.open(path, std::ios_base::out);
if (stats.is_open()) if (stats.is_open())
Log(Debug::Info) << "Stats will be written to: " << path; Log(Debug::Info) << "OSG stats will be written to: " << path;
else else
Log(Debug::Warning) << "Failed to open file for stats: " << path; Log(Debug::Warning) << "Failed to open file to write OSG stats \"" << path
<< "\": " << std::generic_category().message(errno);
} }
// Setup profiler // Setup profiler