Unit tests for difficulty_type
This commit is contained in:
@@ -234,7 +234,9 @@ private:
|
||||
std::ofstream m_logFile;
|
||||
};
|
||||
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
static Worker worker;
|
||||
#endif
|
||||
|
||||
NOINLINE Writer::Writer(Severity severity) : Stream(m_stackBuf)
|
||||
{
|
||||
@@ -252,7 +254,9 @@ NOINLINE Writer::~Writer()
|
||||
m_buf[1] = static_cast<uint8_t>(size & 255);
|
||||
m_buf[2] = static_cast<uint8_t>(size >> 8);
|
||||
m_buf[m_pos] = '\n';
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
worker.write(m_buf, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
void reopen()
|
||||
@@ -263,7 +267,9 @@ void reopen()
|
||||
|
||||
void stop()
|
||||
{
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
worker.stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
NOINLINE void Stream::writeCurrentTime()
|
||||
|
||||
10
src/log.h
10
src/log.h
@@ -384,6 +384,14 @@ namespace {
|
||||
#define CONCAT(a, b) CONCAT2(a, b)
|
||||
#define CONCAT2(a, b) a##b
|
||||
|
||||
#ifdef P2POOL_LOG_DISABLE
|
||||
|
||||
#define LOGINFO(level, ...)
|
||||
#define LOGWARN(level, ...)
|
||||
#define LOGERR(level, ...)
|
||||
|
||||
#else
|
||||
|
||||
#define LOG(level, severity, ...) \
|
||||
do { \
|
||||
if (level <= log::GLOBAL_LOG_LEVEL) { \
|
||||
@@ -398,6 +406,8 @@ namespace {
|
||||
#define LOGWARN(level, ...) LOG(level, log::Severity::Warning, __VA_ARGS__)
|
||||
#define LOGERR(level, ...) LOG(level, log::Severity::Error, __VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
||||
void reopen();
|
||||
void stop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user