mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
crash_printer: use multibyte std::string
This commit is contained in:
parent
00f1268e31
commit
8208d1541d
@ -6,7 +6,7 @@
|
||||
|
||||
namespace crash_printer {
|
||||
|
||||
bool init(const std::wstring &log_file);
|
||||
bool init(const std::string &log_file);
|
||||
|
||||
void deinit();
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
std::wstring logs_filepath = L"./crash_test/zxc.txt";
|
||||
std::string logs_filepath = "./crash_test/zxc.txt";
|
||||
|
||||
|
||||
static LONG WINAPI exception_handler(LPEXCEPTION_POINTERS ex_pointers)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
static LPTOP_LEVEL_EXCEPTION_FILTER originalExceptionFilter = nullptr;
|
||||
|
||||
static std::wstring logs_filepath{};
|
||||
static std::string logs_filepath{};
|
||||
|
||||
static void print_stacktrace(std::ofstream &file, CONTEXT* context) {
|
||||
auto this_proc = GetCurrentProcess();
|
||||
@ -104,7 +104,7 @@ static void log_exception(LPEXCEPTION_POINTERS ex_pointers)
|
||||
return;
|
||||
}
|
||||
|
||||
std::ofstream file(std::filesystem::path(logs_filepath), std::ios::app);
|
||||
std::ofstream file(std::filesystem::u8path(logs_filepath), std::ios::out | std::ios::app);
|
||||
|
||||
std::string time(common_helpers::get_utc_time());
|
||||
common_helpers::write(file, "[" + time + "]");
|
||||
@ -133,7 +133,7 @@ static LONG WINAPI exception_handler(LPEXCEPTION_POINTERS ex_pointers)
|
||||
}
|
||||
|
||||
|
||||
bool crash_printer::init(const std::wstring &log_file)
|
||||
bool crash_printer::init(const std::string &log_file)
|
||||
{
|
||||
logs_filepath = log_file;
|
||||
originalExceptionFilter = SetUnhandledExceptionFilter(exception_handler);
|
||||
|
Loading…
Reference in New Issue
Block a user