mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-31 03:50:20 -07:00
Use helper function for logging messages
This commit is contained in:
parent
ec13bba4da
commit
dba711d099
8 changed files with 26 additions and 29 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue