update logger.cpp

This commit is contained in:
gwdwyy 2013-07-23 11:19:36 +08:00
parent ddb55f7e8e
commit 4c5c3c1ea6

View File

@ -35,7 +35,14 @@ namespace CPPCOMMON
cerr<<"strftime failed."<<endl; cerr<<"strftime failed."<<endl;
return false; return false;
} }
cout<<string_format(_logFormat, _cStrBuf, fileName, lineNo, _logLevel[level], msg.c_str())<<"\n"; if(level >= LL_WARN)
{
cerr<<string_format(_logFormat, _cStrBuf, fileName, lineNo, _logLevel[level], msg.c_str())<<"\n";
}
else
{
cout<<string_format(_logFormat, _cStrBuf, fileName, lineNo, _logLevel[level], msg.c_str())<<"\n";
}
return true; return true;
} }
} }