Added support for unicode paths (filesystem::path approach)
This commit is contained in:
parent
351515f025
commit
b409b5f7cc
14 changed files with 143 additions and 104 deletions
|
|
@ -46,7 +46,7 @@ unsigned int LogManager::getLoglevel()
|
|||
}
|
||||
}
|
||||
|
||||
void LogManager::configure(json config, const std::string &defaultDir)
|
||||
void LogManager::configure(json config, const filesystem::path& defaultDir)
|
||||
{
|
||||
std::lock_guard<std::mutex> grd(entry_mutex);
|
||||
|
||||
|
|
@ -92,11 +92,10 @@ void LogManager::configure(json config, const std::string &defaultDir)
|
|||
/*-------------------------------------------------*\
|
||||
| If the path is relative, use logs dir |
|
||||
\*-------------------------------------------------*/
|
||||
filesystem::path p = logname;
|
||||
filesystem::path p = filesystem::u8path(logname);
|
||||
if(p.is_relative())
|
||||
{
|
||||
p = defaultDir + "logs/";
|
||||
p.append(logname);
|
||||
p = defaultDir / "logs" / logname;
|
||||
}
|
||||
filesystem::create_directories(p.parent_path());
|
||||
|
||||
|
|
@ -351,4 +350,4 @@ void LogManager::UnregisterDialogShowCallback(LogDialogShowCallback callback, vo
|
|||
dialog_show_callback_args.erase(dialog_show_callback_args.begin() + idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue