mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
logs.cpp: print some errors if failed to create logs
This commit is contained in:
parent
b726aa5a3e
commit
7599c66639
@ -9,6 +9,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cerrno>
|
||||||
|
|
||||||
using namespace std::literals::chrono_literals;
|
using namespace std::literals::chrono_literals;
|
||||||
|
|
||||||
@ -363,7 +364,10 @@ logs::file_writer::file_writer(const std::string& name, u64 max_size)
|
|||||||
m_fptr = std::make_unique<uchar[]>(s_log_size);
|
m_fptr = std::make_unique<uchar[]>(s_log_size);
|
||||||
|
|
||||||
// Actual log file (allowed to fail)
|
// Actual log file (allowed to fail)
|
||||||
m_fout.open(name, fs::rewrite);
|
if (!m_fout.open(name, fs::rewrite))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Log file open failed: %s (error %d)\n", name.c_str(), errno);
|
||||||
|
}
|
||||||
|
|
||||||
// Compressed log, make it inaccessible (foolproof)
|
// Compressed log, make it inaccessible (foolproof)
|
||||||
if (m_fout2.open(name + ".gz", fs::rewrite + fs::unread))
|
if (m_fout2.open(name + ".gz", fs::rewrite + fs::unread))
|
||||||
@ -379,6 +383,11 @@ logs::file_writer::file_writer(const std::string& name, u64 max_size)
|
|||||||
m_fout2.close();
|
m_fout2.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_fout2)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Log file open failed: %s.gz (error %d)\n", name.c_str(), errno);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Autodelete compressed log file
|
// Autodelete compressed log file
|
||||||
FILE_DISPOSITION_INFO disp;
|
FILE_DISPOSITION_INFO disp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user