Browse Source

cc log levels corr

pull/4/head
dimxy 5 years ago
parent
commit
9fdb634a4e
  1. 9
      src/cc/CCinclude.h
  2. 2
      src/cc/CCtokens.cpp

9
src/cc/CCinclude.h

@ -266,6 +266,7 @@ UniValue ValueFromAmount(const CAmount& amount);
#define CCLOG_DEBUG1 1
#define CCLOG_DEBUG2 2
#define CCLOG_DEBUG3 3
#define CCLOG_MAXLEVEL 3
template <class T>
inline void CCLogPrintStream(const char *category, int level, T print_to_stream)
{
@ -273,10 +274,10 @@ inline void CCLogPrintStream(const char *category, int level, T print_to_stream)
print_to_stream(stream);
if (level < 0)
level = 0;
if (level > 3)
level = 3;
for (int i = 0; i < level; i++)
if (LogAcceptCategory((std::string(category) + (level > 0 ? std::string("-") + std::to_string(level) : std::string(""))).c_str())) {
if (level > CCLOG_MAXLEVEL)
level = CCLOG_MAXLEVEL;
for (int i = level; i <= CCLOG_MAXLEVEL; i++)
if (LogAcceptCategory((std::string(category) + (i > 0 ? std::string("-") + std::to_string(i) : std::string(""))).c_str())) {
LogPrintStr(stream.str());
break;
}

2
src/cc/CCtokens.cpp

@ -178,7 +178,7 @@ uint8_t DecodeTokenOpRet(const CScript scriptPubKey, uint8_t &evalCodeTokens, ui
return (uint8_t)0;
funcId = script[1];
LOGSTREAM((char *)"cctokens", CCLOG_DEBUG2, stream << "DecodeTokenOpRet decoded funcId=" << (char)(funcId?funcId:' '));
LOGSTREAM((char *)"cctokens", CCLOG_DEBUG2, stream << "DecodeTokenOpRet decoded funcId=" << (char)(funcId?funcId:' ') << std::endl);
switch( funcId )
{

Loading…
Cancel
Save