Fix xenia.log file not always being created in the executable folder.
This commit is contained in:
parent
c7da7e1999
commit
5296d2e91e
|
@ -439,9 +439,7 @@ void InitializeLogging(const std::string_view app_name) {
|
||||||
if (cvars::log_file.empty()) {
|
if (cvars::log_file.empty()) {
|
||||||
// Default to app name.
|
// Default to app name.
|
||||||
auto file_name = fmt::format("{}.log", app_name);
|
auto file_name = fmt::format("{}.log", app_name);
|
||||||
auto file_path = std::filesystem::path(file_name);
|
auto file_path = xe::filesystem::GetExecutableFolder() / file_name;
|
||||||
xe::filesystem::CreateParentFolder(file_path);
|
|
||||||
|
|
||||||
log_file = xe::filesystem::OpenFile(file_path, "wt");
|
log_file = xe::filesystem::OpenFile(file_path, "wt");
|
||||||
} else {
|
} else {
|
||||||
xe::filesystem::CreateParentFolder(cvars::log_file);
|
xe::filesystem::CreateParentFolder(cvars::log_file);
|
||||||
|
|
Loading…
Reference in New Issue