Merge pull request #2195
599436a4
mlog: default to msgwriter logs only for log level 1 (moneromooo-monero)58f3fc68
Make msgwriter logs go to file only (moneromooo-monero)
This commit is contained in:
commit
b6ae718456
3 changed files with 3 additions and 2 deletions
|
@ -60,6 +60,7 @@
|
||||||
#define MCDEBUG(cat,x) CLOG(DEBUG,cat) << x
|
#define MCDEBUG(cat,x) CLOG(DEBUG,cat) << x
|
||||||
#define MCTRACE(cat,x) CLOG(TRACE,cat) << x
|
#define MCTRACE(cat,x) CLOG(TRACE,cat) << x
|
||||||
#define MCLOG(level,cat,x) ELPP_WRITE_LOG(el::base::Writer, level, el::base::DispatchAction::NormalLog, cat) << x
|
#define MCLOG(level,cat,x) ELPP_WRITE_LOG(el::base::Writer, level, el::base::DispatchAction::NormalLog, cat) << x
|
||||||
|
#define MCLOG_FILE(level,cat,x) ELPP_WRITE_LOG(el::base::Writer, level, el::base::DispatchAction::FileOnlyLog, cat) << x
|
||||||
|
|
||||||
#define MCLOG_COLOR(level,cat,color,x) MCLOG(level,cat,"\033[1;" color "m" << x << "\033[0m")
|
#define MCLOG_COLOR(level,cat,color,x) MCLOG(level,cat,"\033[1;" color "m" << x << "\033[0m")
|
||||||
#define MCLOG_RED(level,cat,x) MCLOG_COLOR(level,cat,"31",x)
|
#define MCLOG_RED(level,cat,x) MCLOG_COLOR(level,cat,"31",x)
|
||||||
|
|
|
@ -91,7 +91,7 @@ static const char *get_default_categories(int level)
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
categories = "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO";
|
categories = "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
categories = "*:WARNING,global:INFO,stacktrace:INFO,logging:INFO,msgwriter:INFO";
|
categories = "*:WARNING,global:INFO,stacktrace:INFO,logging:INFO,msgwriter:INFO";
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
{
|
{
|
||||||
m_flush = false;
|
m_flush = false;
|
||||||
|
|
||||||
MCLOG(m_log_level, "msgwriter", m_oss.str());
|
MCLOG_FILE(m_log_level, "msgwriter", m_oss.str());
|
||||||
|
|
||||||
if (epee::console_color_default == m_color)
|
if (epee::console_color_default == m_color)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue