mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Use helper function for logging messages
This commit is contained in:
@@ -50,7 +50,6 @@ void WebUI::configure()
|
||||
{
|
||||
m_isErrored = false; // clear previous error state
|
||||
|
||||
Logger *const logger = Logger::instance();
|
||||
Preferences *const pref = Preferences::instance();
|
||||
|
||||
const quint16 oldPort = m_port;
|
||||
@@ -100,9 +99,9 @@ void WebUI::configure()
|
||||
|
||||
const bool success = m_httpServer->setupHttps(cert, key);
|
||||
if (success)
|
||||
logger->addMessage(tr("Web UI: HTTPS setup successful"));
|
||||
LogMsg(tr("Web UI: HTTPS setup successful"));
|
||||
else
|
||||
logger->addMessage(tr("Web UI: HTTPS setup failed, fallback to HTTP"), Log::CRITICAL);
|
||||
LogMsg(tr("Web UI: HTTPS setup failed, fallback to HTTP"), Log::CRITICAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,13 +115,13 @@ void WebUI::configure()
|
||||
bool success = m_httpServer->listen(address, m_port);
|
||||
if (success)
|
||||
{
|
||||
logger->addMessage(tr("Web UI: Now listening on IP: %1, port: %2").arg(serverAddressString).arg(m_port));
|
||||
LogMsg(tr("Web UI: Now listening on IP: %1, port: %2").arg(serverAddressString).arg(m_port));
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString errorMsg = tr("Web UI: Unable to bind to IP: %1, port: %2. Reason: %3")
|
||||
.arg(serverAddressString).arg(m_port).arg(m_httpServer->errorString());
|
||||
logger->addMessage(errorMsg, Log::CRITICAL);
|
||||
LogMsg(errorMsg, Log::CRITICAL);
|
||||
qCritical() << errorMsg;
|
||||
|
||||
m_isErrored = true;
|
||||
|
||||
Reference in New Issue
Block a user