Logger: print to stdout till log file path gets initialized

This commit is contained in:
xiphon 2020-11-04 01:42:19 +00:00
parent 04429e85e6
commit 6f5bacabfd
2 changed files with 2 additions and 2 deletions

View File

@ -117,13 +117,14 @@ Logger::Logger(QCoreApplication &parent, QString userDefinedLogFilePath)
c.setGlobally(el::ConfigurationType::ToFile, "false"); c.setGlobally(el::ConfigurationType::ToFile, "false");
c.setGlobally(el::ConfigurationType::ToStandardOutput, "true"); c.setGlobally(el::ConfigurationType::ToStandardOutput, "true");
el::Loggers::setDefaultConfigurations(c, true); el::Loggers::setDefaultConfigurations(c, true);
qInstallMessageHandler(messageHandler);
} }
void Logger::resetLogFilePath(bool portable) void Logger::resetLogFilePath(bool portable)
{ {
m_logFilePath = QDir::toNativeSeparators(getLogPath(m_userDefinedLogFilePath, portable)); m_logFilePath = QDir::toNativeSeparators(getLogPath(m_userDefinedLogFilePath, portable));
Monero::Wallet::init(m_applicationFilePath.c_str(), "monero-wallet-gui", m_logFilePath.toStdString(), true); Monero::Wallet::init(m_applicationFilePath.c_str(), "monero-wallet-gui", m_logFilePath.toStdString(), true);
qInstallMessageHandler(messageHandler); qWarning() << "Logging to" << m_logFilePath;
emit logFilePathChanged(); emit logFilePathChanged();
} }

View File

@ -275,7 +275,6 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
if (logLevelOk && logLevel >= 0 && logLevel <= Monero::WalletManagerFactory::LogLevel_Max){ if (logLevelOk && logLevel >= 0 && logLevel <= Monero::WalletManagerFactory::LogLevel_Max){
Monero::WalletManagerFactory::setLogLevel(logLevel); Monero::WalletManagerFactory::setLogLevel(logLevel);
} }
qWarning().noquote() << "app startd" << "(log: " + logger.logFilePath() + ")";
if (parser.isSet(verifyUpdateOption)) if (parser.isSet(verifyUpdateOption))
{ {