mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
Fix logging deadlock
(cherry picked from commit a83a46d60059a063ec953ba15f4cdcc2b3874440)
This commit is contained in:
+2
-1
@@ -3057,8 +3057,9 @@ void Writer::triggerDispatch(void) {
|
||||
}
|
||||
if (m_proceed && m_level == Level::Fatal
|
||||
&& !ELPP->hasFlag(LoggingFlag::DisableApplicationAbortOnFatalLog)) {
|
||||
const std::string str = "Aborting application. Reason: Fatal log at [" + std::string(m_file) + ":" + std::to_string(m_line) + "]";
|
||||
base::Writer(Level::Warning, Color::Default, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId)
|
||||
<< "Aborting application. Reason: Fatal log at [" << m_file << ":" << m_line << "]";
|
||||
<< str;
|
||||
std::stringstream reasonStream;
|
||||
reasonStream << "Fatal log at [" << m_file << ":" << m_line << "]"
|
||||
<< " If you wish to disable 'abort on fatal log' please use "
|
||||
|
||||
+3
-24
@@ -3272,9 +3272,7 @@ class Writer : base::NoCopy {
|
||||
processDispatch();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename std::enable_if<std::is_integral<T>::value, Writer&>::type
|
||||
operator<<(T log) {
|
||||
Writer& operator<<(const std::string &log) {
|
||||
#if ELPP_LOGGING_ENABLED
|
||||
if (m_proceed) {
|
||||
m_messageBuilder << log;
|
||||
@@ -3283,26 +3281,6 @@ class Writer : base::NoCopy {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename std::enable_if<!std::is_integral<T>::value, Writer&>::type
|
||||
operator<<(const T& log) {
|
||||
#if ELPP_LOGGING_ENABLED
|
||||
if (m_proceed) {
|
||||
m_messageBuilder << log;
|
||||
}
|
||||
#endif // ELPP_LOGGING_ENABLED
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Writer& operator<<(std::ostream& (*log)(std::ostream&)) {
|
||||
#if ELPP_LOGGING_ENABLED
|
||||
if (m_proceed) {
|
||||
m_messageBuilder << log;
|
||||
}
|
||||
#endif // ELPP_LOGGING_ENABLED
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline operator bool() {
|
||||
return true;
|
||||
}
|
||||
@@ -3619,8 +3597,9 @@ class DefaultPerformanceTrackingCallback : public PerformanceTrackingCallback {
|
||||
ss << ELPP_LITERAL("]");
|
||||
}
|
||||
}
|
||||
const std::string str = ss.str();
|
||||
el::base::Writer(m_data->performanceTracker()->level(), m_data->file(), m_data->line(), m_data->func()).construct(1,
|
||||
m_data->loggerId().c_str()) << ss.str();
|
||||
m_data->loggerId().c_str()) << str;
|
||||
}
|
||||
private:
|
||||
const PerformanceTrackingData* m_data;
|
||||
|
||||
Reference in New Issue
Block a user