Skip to content

Commit de1068b

Browse files
committed
feat(base):优化LogBacktrace(),添加日志等级参数
1 parent 3c0831e commit de1068b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/base/backtrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ std::string DumpBacktrace(const unsigned int max_frames = 64);
3030

3131
}
3232

33-
#define LogBacktrace() LogTrace("call stack:\n%s", tbox::DumpBacktrace().c_str())
33+
#define LogBacktrace(level) LogPrintf((level), "call stack:\n%s", tbox::DumpBacktrace().c_str())
3434

3535
#endif // TBOX_BACKTRACE_H_20220708

modules/base/backtrace_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace tbox {
2727
TEST(Backtrace, _)
2828
{
2929
LogOutput_Enable();
30-
LogBacktrace();
30+
LogBacktrace(LOG_LEVEL_TRACE);
3131
LogOutput_Disable();
3232
}
3333

0 commit comments

Comments
 (0)