From: Sangyoon Jang Date: Mon, 22 May 2023 06:20:09 +0000 (+0900) Subject: Fix log format X-Git-Tag: accepted/tizen/unified/20230608.164337~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git;a=commitdiff_plain;h=aaf923173eb0562602cf3b31504e420aa3e52795 Fix log format Add function name. Change-Id: Ibfd34d54bead1e289f0cc0e5caae45d1431eff11 Signed-off-by: Sangyoon Jang --- diff --git a/src/utils/logging.hh b/src/utils/logging.hh index 093d63f..e336380 100644 --- a/src/utils/logging.hh +++ b/src/utils/logging.hh @@ -38,20 +38,6 @@ enum class LogLevel { log_priority LogLevelToPriority(LogLevel level); -template struct LogTag; -template<> struct LogTag { - static constexpr const char* value = "\033[1;31m| ERROR |\033[0m"; -}; -template<> struct LogTag { - static constexpr const char* value = "\033[1;33m| WARNING |\033[0m"; -}; -template<> struct LogTag { - static constexpr const char* value = "\033[1;32m| INFO |\033[0m"; -}; -template<> struct LogTag { - static constexpr const char* value = "\033[0m| DEBUG |\033[0m"; -}; - template > class StringStream : private std::basic_ostringstream { public: @@ -108,9 +94,9 @@ inline static const constexpr char* __tag_for_project() { ::utils::LogCatcher( \ ::utils::LogLevel::LOG_ ## LEVEL, __tag_for_project()) \ & ::utils::StringStream() \ - << std::string(::utils::LogTag<::utils::LogLevel::LOG_ ## LEVEL>::value) \ - << " : " << std::setw(36) \ - << (std::string(__FILENAME__) + ":" + std::to_string(__LINE__)).c_str() \ + << std::setw(50) << std::right \ + << (std::string(__FILENAME__) + ": " + std::string(__FUNCTION__) + "(" + \ + std::to_string(__LINE__) + ")").c_str() \ << std::setw(0) << " : " \ #endif // LOGGING_HH_