common: Address feedback

This commit is contained in:
GPUCode
2023-07-03 02:17:03 +03:00
parent 9527bfffed
commit d7b4260389
8 changed files with 29 additions and 16 deletions

View File

@ -202,7 +202,7 @@ public:
return *instance;
}
static void Initialize() {
static void Initialize(std::string_view log_file) {
if (instance) {
LOG_WARNING(Log, "Reinitializing logging backend");
return;
@ -212,8 +212,8 @@ public:
void(FileUtil::CreateDir(log_dir));
Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue());
instance = std::unique_ptr<Impl, decltype(&Deleter)>(new Impl(log_dir + LOG_FILE, filter),
Deleter);
instance = std::unique_ptr<Impl, decltype(&Deleter)>(
new Impl(fmt::format("{}{}", log_dir, log_file), filter), Deleter);
initialization_in_progress_suppress_logging = false;
}
@ -414,8 +414,8 @@ private:
};
} // namespace
void Initialize() {
Impl::Initialize();
void Initialize(std::string_view log_file) {
Impl::Initialize(log_file.empty() ? LOG_FILE : log_file);
}
void Start() {