diff --git a/src/ulib/log/log.h b/src/ulib/log/log.h index 783d54d..f0d7843 100644 --- a/src/ulib/log/log.h +++ b/src/ulib/log/log.h @@ -18,12 +18,13 @@ namespace tqcq { std::string __fmt_str; \ try { \ __fmt_str = fmt::format(fmt_str, ##__VA_ARGS__); \ - catch (const std::exception &e) { __fmt_str = e.what(); } \ - tqcq::Logger::GetInstance().Log( \ - level, __FILE__, __FUNCTION__, __LINE__, tag, \ - fmt::format(fmt_str, ##__VA_ARGS__).c_str()); \ + } catch (const std::exception &e) { \ + __fmt_str = e.what(); \ } \ - while (0) + tqcq::Logger::GetInstance().Log( \ + level, __FILE__, __FUNCTION__, __LINE__, tag, \ + fmt::format(fmt_str, ##__VA_ARGS__).c_str()); \ + } while (0) #define ULOG_SET_STRIPPED_PREFIX_LEN(len) \ ::tqcq::Logger::GetInstance().SetStrippedPrefixLen(len)