mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-05 10:29:27 +00:00
Settings: add option to disable logging to disk
This commit is contained in:
parent
f9019cb1b0
commit
a8d33099a2
5 changed files with 25 additions and 2 deletions
|
@ -27,6 +27,10 @@ Settings::Settings(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
config()->set(Config::hideBalance, toggled);
|
config()->set(Config::hideBalance, toggled);
|
||||||
m_ctx->updateBalance();
|
m_ctx->updateBalance();
|
||||||
});
|
});
|
||||||
|
connect(ui->checkBox_disableLogging, &QCheckBox::toggled, [this](bool toggled){
|
||||||
|
config()->set(Config::disableLogging, toggled);
|
||||||
|
WalletManager::instance()->setLogLevel(toggled ? -1 : config()->get(Config::logLevel).toInt());
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
|
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
|
||||||
|
|
||||||
|
@ -39,6 +43,7 @@ Settings::Settings(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
ui->checkBox_multiBroadcast->setChecked(config()->get(Config::multiBroadcast).toBool());
|
ui->checkBox_multiBroadcast->setChecked(config()->get(Config::multiBroadcast).toBool());
|
||||||
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
|
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
|
||||||
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
|
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
|
||||||
|
ui->checkBox_disableLogging->setChecked(config()->get(Config::disableLogging).toBool());
|
||||||
|
|
||||||
// setup comboboxes
|
// setup comboboxes
|
||||||
this->setupSkinCombobox();
|
this->setupSkinCombobox();
|
||||||
|
|
|
@ -211,6 +211,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_disableLogging">
|
||||||
|
<property name="text">
|
||||||
|
<string>Do not write log files to disk</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_node">
|
<widget class="QWidget" name="tab_node">
|
||||||
|
|
11
src/main.cpp
11
src/main.cpp
|
@ -143,11 +143,18 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||||
|
|
||||||
bool logLevelFromEnv;
|
bool logLevelFromEnv;
|
||||||
int logLevel = qEnvironmentVariableIntValue("MONERO_LOG_LEVEL", &logLevelFromEnv);
|
int logLevel = qEnvironmentVariableIntValue("MONERO_LOG_LEVEL", &logLevelFromEnv);
|
||||||
|
if (!logLevelFromEnv) {
|
||||||
|
logLevel = 0;
|
||||||
|
}
|
||||||
|
config()->set(Config::logLevel, logLevel);
|
||||||
|
|
||||||
if (parser.isSet("quiet"))
|
if (parser.isSet("quiet") || config()->get(Config::disableLogging).toBool()) {
|
||||||
|
qWarning() << "Logging is disabled";
|
||||||
WalletManager::instance()->setLogLevel(-1);
|
WalletManager::instance()->setLogLevel(-1);
|
||||||
else if (logLevelFromEnv && logLevel >= 0 && logLevel <= Monero::WalletManagerFactory::LogLevel_Max)
|
}
|
||||||
|
else if (logLevelFromEnv && logLevel >= 0 && logLevel <= Monero::WalletManagerFactory::LogLevel_Max) {
|
||||||
Monero::WalletManagerFactory::setLogLevel(logLevel);
|
Monero::WalletManagerFactory::setLogLevel(logLevel);
|
||||||
|
}
|
||||||
|
|
||||||
// Setup wallet directory
|
// Setup wallet directory
|
||||||
QString walletDir = config()->get(Config::walletDirectory).toString();
|
QString walletDir = config()->get(Config::walletDirectory).toString();
|
||||||
|
|
|
@ -20,6 +20,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||||
{Config::firstRun, {QS("firstRun"), true}},
|
{Config::firstRun, {QS("firstRun"), true}},
|
||||||
{Config::warnOnStagenet,{QS("warnOnStagenet"), true}},
|
{Config::warnOnStagenet,{QS("warnOnStagenet"), true}},
|
||||||
{Config::warnOnTestnet,{QS("warnOnTestnet"), true}},
|
{Config::warnOnTestnet,{QS("warnOnTestnet"), true}},
|
||||||
|
{Config::logLevel,{QS("logLevel"), 0}},
|
||||||
|
|
||||||
{Config::homeWidget,{QS("homeWidget"), "ccs"}},
|
{Config::homeWidget,{QS("homeWidget"), "ccs"}},
|
||||||
{Config::donateBeg,{QS("donateBeg"), 1}},
|
{Config::donateBeg,{QS("donateBeg"), 1}},
|
||||||
|
@ -68,6 +69,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||||
{Config::multiBroadcast, {QS("multiBroadcast"), true}},
|
{Config::multiBroadcast, {QS("multiBroadcast"), true}},
|
||||||
{Config::warnOnExternalLink,{QS("warnOnExternalLink"), true}},
|
{Config::warnOnExternalLink,{QS("warnOnExternalLink"), true}},
|
||||||
{Config::hideBalance, {QS("hideBalance"), false}},
|
{Config::hideBalance, {QS("hideBalance"), false}},
|
||||||
|
{Config::disableLogging, {QS("disableLogging"), false}},
|
||||||
|
|
||||||
{Config::blockExplorer,{QS("blockExplorer"), "exploremonero.com"}},
|
{Config::blockExplorer,{QS("blockExplorer"), "exploremonero.com"}},
|
||||||
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
|
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
firstRun,
|
firstRun,
|
||||||
warnOnStagenet,
|
warnOnStagenet,
|
||||||
warnOnTestnet,
|
warnOnTestnet,
|
||||||
|
logLevel,
|
||||||
|
|
||||||
homeWidget,
|
homeWidget,
|
||||||
donateBeg,
|
donateBeg,
|
||||||
|
@ -72,6 +73,7 @@ public:
|
||||||
multiBroadcast,
|
multiBroadcast,
|
||||||
warnOnExternalLink,
|
warnOnExternalLink,
|
||||||
hideBalance,
|
hideBalance,
|
||||||
|
disableLogging,
|
||||||
|
|
||||||
blockExplorer,
|
blockExplorer,
|
||||||
redditFrontend,
|
redditFrontend,
|
||||||
|
|
Loading…
Reference in a new issue