mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-28 02:26:07 +00:00
QOL: Set Log Filter On Save (#991)
* set log filter on reset * clang format
This commit is contained in:
parent
079d90211f
commit
077f8981a7
|
@ -144,6 +144,10 @@ public:
|
||||||
initialization_in_progress_suppress_logging = false;
|
initialization_in_progress_suppress_logging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsActive() {
|
||||||
|
return instance != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
static void Start() {
|
static void Start() {
|
||||||
instance->StartBackendThread();
|
instance->StartBackendThread();
|
||||||
}
|
}
|
||||||
|
@ -275,6 +279,10 @@ void Initialize(std::string_view log_file) {
|
||||||
Impl::Initialize(log_file.empty() ? LOG_FILE : log_file);
|
Impl::Initialize(log_file.empty() ? LOG_FILE : log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsActive() {
|
||||||
|
return Impl::IsActive();
|
||||||
|
}
|
||||||
|
|
||||||
void Start() {
|
void Start() {
|
||||||
Impl::Start();
|
Impl::Start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ class Filter;
|
||||||
/// Initializes the logging system. This should be the first thing called in main.
|
/// Initializes the logging system. This should be the first thing called in main.
|
||||||
void Initialize(std::string_view log_file = "");
|
void Initialize(std::string_view log_file = "");
|
||||||
|
|
||||||
|
bool IsActive();
|
||||||
|
|
||||||
/// Starts the logging threads.
|
/// Starts the logging threads.
|
||||||
void Start();
|
void Start();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
|
|
||||||
|
#include "common/logging/backend.h"
|
||||||
|
#include "common/logging/filter.h"
|
||||||
#include "main_window.h"
|
#include "main_window.h"
|
||||||
#include "settings_dialog.h"
|
#include "settings_dialog.h"
|
||||||
#include "ui_settings_dialog.h"
|
#include "ui_settings_dialog.h"
|
||||||
|
@ -78,6 +80,11 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
||||||
Config::setDefaultValues();
|
Config::setDefaultValues();
|
||||||
LoadValuesFromConfig();
|
LoadValuesFromConfig();
|
||||||
}
|
}
|
||||||
|
if (Common::Log::IsActive()) {
|
||||||
|
Common::Log::Filter filter;
|
||||||
|
filter.ParseFilterString(Config::getLogFilter());
|
||||||
|
Common::Log::SetGlobalFilter(filter);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save"));
|
ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save"));
|
||||||
|
|
Loading…
Reference in a new issue