diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-01-06 20:38:10 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-01-06 20:38:10 +0200 |
commit | 3ce797738929ec9651e83c76f7e5aa83bc2fb50d (patch) | |
tree | a2225d3caab22ce305165d0ea971d0e6183f055a /external/easylogging++/easylogging++.cc | |
parent | Merge pull request #4949 (diff) | |
parent | easylogging++: check allowed categories before logging (diff) | |
download | monero-3ce797738929ec9651e83c76f7e5aa83bc2fb50d.tar.xz |
Merge pull request #4950
68f045de easylogging++: check allowed categories before logging (moneromooo-monero)
Diffstat (limited to 'external/easylogging++/easylogging++.cc')
-rw-r--r-- | external/easylogging++/easylogging++.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc index ab4ee49c3..f5f7481f8 100644 --- a/external/easylogging++/easylogging++.cc +++ b/external/easylogging++/easylogging++.cc @@ -2693,6 +2693,12 @@ Writer& Writer::construct(int count, const char* loggerIds, ...) { return *this; } +Writer& Writer::construct(const char *loggerId) { + initializeLogger(ELPP->registeredLoggers()->get(loggerId, ELPP->hasFlag(LoggingFlag::CreateLoggerAutomatically))); + m_messageBuilder.initialize(m_logger); + return *this; +} + void Writer::initializeLogger(const std::string& loggerId, bool lookup, bool needLock) { if (lookup) { m_logger = ELPP->registeredLoggers()->get(loggerId, ELPP->hasFlag(LoggingFlag::CreateLoggerAutomatically)); @@ -2721,6 +2727,19 @@ void Writer::initializeLogger(const std::string& loggerId, bool lookup, bool nee } } +void Writer::initializeLogger(Logger *logger, bool needLock) { + m_logger = logger; + if (m_logger == nullptr) { + m_proceed = false; + } else { + if (needLock) { + m_logger->acquireLock(); // This should not be unlocked by checking m_proceed because + // m_proceed can be changed by lines below + } + m_proceed = true; + } +} + void Writer::processDispatch() { #if ELPP_LOGGING_ENABLED if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { |