qBittorrent
|
#include <logger.h>
Signals | |
void | newLogMessage (const Log::Msg &message) |
void | newLogPeer (const Log::Peer &peer) |
Public Member Functions | |
void | addMessage (const QString &message, const Log::MsgType &type=Log::NORMAL) |
void | addPeer (const QString &ip, bool blocked, const QString &reason={}) |
QVector< Log::Msg > | getMessages (int lastKnownId=-1) const |
QVector< Log::Peer > | getPeers (int lastKnownId=-1) const |
Static Public Member Functions | |
static void | initInstance () |
static void | freeInstance () |
static Logger * | instance () |
Private Member Functions | |
Logger () | |
~Logger ()=default | |
Private Attributes | |
boost::circular_buffer_space_optimized< Log::Msg > | m_messages |
boost::circular_buffer_space_optimized< Log::Peer > | m_peers |
QReadWriteLock | m_lock |
int | m_msgCounter = 0 |
int | m_peerCounter = 0 |
Static Private Attributes | |
static Logger * | m_instance = nullptr |
|
private |
Definition at line 50 of file logger.cpp.
Referenced by initInstance().
|
privatedefault |
void Logger::addMessage | ( | const QString & | message, |
const Log::MsgType & | type = Log::NORMAL |
||
) |
Definition at line 73 of file logger.cpp.
References m_lock, m_messages, m_msgCounter, and newLogMessage().
Referenced by Application::Application(), WebUI::configure(), RSS::Session::load(), Net::GeoIPManager::loadDatabase(), RSS::Session::loadLegacy(), Net::Smtp::logError(), LogMsg(), MainWindow::notifyOfUpdate(), MainWindow::optionsSaved(), Net::DNSUpdater::processIPUpdateReply(), Http::Connection::read(), anonymous_namespace{settingsstorage.cpp}::TransactionalSettings::read(), anonymous_namespace{settingsstorage.cpp}::TransactionalSettings::serialize(), RSS::Session::Session(), Application::torrentFinished(), and Net::DNSUpdater::updateCredentials().
void Logger::addPeer | ( | const QString & | ip, |
bool | blocked, | ||
const QString & | reason = {} |
||
) |
Definition at line 83 of file logger.cpp.
References m_lock, m_peerCounter, m_peers, and newLogPeer().
Referenced by BitTorrent::Session::handlePeerBanAlert(), and BitTorrent::Session::handlePeerBlockedAlert().
|
static |
Definition at line 67 of file logger.cpp.
References m_instance.
Referenced by Application::cleanup().
QVector< Log::Msg > Logger::getMessages | ( | int | lastKnownId = -1 | ) | const |
Definition at line 93 of file logger.cpp.
References anonymous_namespace{logger.cpp}::loadFromBuffer(), m_lock, m_messages, and m_msgCounter.
Referenced by FileLogger::FileLogger(), and LogController::mainAction().
QVector< Log::Peer > Logger::getPeers | ( | int | lastKnownId = -1 | ) | const |
Definition at line 109 of file logger.cpp.
References anonymous_namespace{logger.cpp}::loadFromBuffer(), m_lock, m_peerCounter, and m_peers.
Referenced by LogController::peersAction().
|
static |
Definition at line 61 of file logger.cpp.
References Logger(), and m_instance.
Referenced by Application::Application().
|
static |
Definition at line 56 of file logger.cpp.
References m_instance.
Referenced by Application::Application(), WebUI::configure(), FileLogger::FileLogger(), BitTorrent::Session::handlePeerBanAlert(), BitTorrent::Session::handlePeerBlockedAlert(), RSS::Session::load(), Net::GeoIPManager::loadDatabase(), RSS::Session::loadLegacy(), Net::Smtp::logError(), LogMsg(), LogPeerModel::LogPeerModel(), LogController::mainAction(), MainWindow::notifyOfUpdate(), MainWindow::optionsSaved(), LogController::peersAction(), Net::DNSUpdater::processIPUpdateReply(), Http::Connection::read(), anonymous_namespace{settingsstorage.cpp}::TransactionalSettings::read(), anonymous_namespace{settingsstorage.cpp}::TransactionalSettings::serialize(), RSS::Session::Session(), Application::torrentFinished(), and Net::DNSUpdater::updateCredentials().
|
signal |
Referenced by addMessage(), and FileLogger::FileLogger().
|
signal |
Referenced by addPeer(), and LogPeerModel::LogPeerModel().
|
staticprivate |
Definition at line 95 of file logger.h.
Referenced by freeInstance(), initInstance(), and instance().
|
mutableprivate |
Definition at line 98 of file logger.h.
Referenced by addMessage(), addPeer(), getMessages(), and getPeers().
|
private |
Definition at line 96 of file logger.h.
Referenced by addMessage(), and getMessages().
|
private |
Definition at line 99 of file logger.h.
Referenced by addMessage(), and getMessages().
|
private |
Definition at line 100 of file logger.h.
Referenced by addPeer(), and getPeers().
|
private |
Definition at line 97 of file logger.h.
Referenced by addPeer(), and getPeers().