Skip to content

Commit de77591

Browse files
committed
fixed:scriptstdouterr.cpp:104: 错误:‘log4cxx’未声明
1 parent 102120f commit de77591

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

kbe/src/lib/helper/debug_helper.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,17 @@ void DebugHelper::script_msg(const std::string& s)
515515
{
516516
KBEngine::thread::ThreadGuard tg(&this->logMutex);
517517

518+
const size_t len = 33; // strlen("Traceback (most recent call last)");
519+
520+
if(s.size() > len)
521+
{
522+
if(s[0] == 'T' && s[10] == '(')
523+
{
524+
if(s.substr(0, len) == "Traceback (most recent call last)")
525+
setScriptMsgType(log4cxx::ScriptLevel::SCRIPT_ERR);
526+
}
527+
}
528+
518529
#ifdef NO_USE_LOG4CXX
519530
#else
520531
if(canLogFile_)

kbe/src/lib/pyscript/scriptstdouterr.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ along with KBEngine. If not, see <http://www.gnu.org/licenses/>.
2020

2121

2222
#include "scriptstdouterr.hpp"
23-
#include "helper/script_loglevel.hpp"
2423

2524
#ifndef CODE_INLINE
2625
#include "scriptstdouterr.ipp"
@@ -94,16 +93,6 @@ void ScriptStdOutErr::onPrint(const wchar_t* msg, uint32 msglen)
9493
{
9594
std::string out;
9695
strutil::wchar2utf8(sbuffer_, out);
97-
98-
const char* tracebackflag = "Traceback (most recent call last)";
99-
size_t len = strlen(tracebackflag);
100-
101-
if(out.size() > len)
102-
{
103-
if(out.substr(0, len) == tracebackflag)
104-
DebugHelper::getSingleton().setScriptMsgType(log4cxx::ScriptLevel::SCRIPT_ERR);
105-
}
106-
10796
SCRIPT_MSG(out);
10897
sbuffer_ = L"";
10998
}

0 commit comments

Comments
 (0)