From 607b1f8ede81450a3a6a19f4fd1570b1540727c8 Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Mon, 29 Apr 2019 13:11:47 +0200 Subject: [PATCH] logging: initial log level set by ENV var --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index eca65333..6fd78997 100644 --- a/main.cpp +++ b/main.cpp @@ -140,7 +140,12 @@ int main(int argc, char *argv[]) // loglevel is configured in main.qml. Anything lower than - // qWarning is not shown here. + // qWarning is not shown here unless MONERO_LOG_LEVEL env var is set + bool logLevelOk; + int logLevel = qEnvironmentVariableIntValue("MONERO_LOG_LEVEL", &logLevelOk); + if (logLevelOk && logLevel >= 0 && logLevel <= Monero::WalletManagerFactory::LogLevel_Max){ + Monero::WalletManagerFactory::setLogLevel(logLevel); + } qWarning().noquote() << "app startd" << "(log: " + logPath + ")"; // screen settings