Commit cea02a5b by xiongziliang

bug fixed

parent fa6eedc4
...@@ -132,16 +132,16 @@ API_EXPORT void API_CALL log_setLevel(LogType level){ ...@@ -132,16 +132,16 @@ API_EXPORT void API_CALL log_setLevel(LogType level){
class LogoutChannel: public LogChannel { class LogoutChannel: public LogChannel {
public: public:
LogoutChannel(const string &name, onLogOut cb, LogLevel level = LDebug) LogoutChannel(const string &name, onLogOut cb, LogLevel level = LDebug)
:LogChannel(name, level, "%Y-%m-%d %H:%M:%S"){ :LogChannel(name, level){
_cb = cb; _cb = cb;
} }
virtual ~LogoutChannel(){} virtual ~LogoutChannel(){}
void write(const LogInfo_ptr &logInfo){ void write(const LogInfo_ptr &logInfo){
if (level() > logInfo->getLevel()) { if (level() > logInfo->_level) {
return; return;
} }
stringstream strStream; stringstream strStream;
logInfo->format(strStream, timeFormat().data(), false); logInfo->format(strStream, false);
auto strTmp = strStream.str(); auto strTmp = strStream.str();
if (_cb) { if (_cb) {
_cb(strTmp.data(), strTmp.size()); _cb(strTmp.data(), strTmp.size());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论