Fix log format 77/293177/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 22 May 2023 06:20:09 +0000 (15:20 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 22 May 2023 06:20:09 +0000 (15:20 +0900)
Add function name.

Change-Id: Ibfd34d54bead1e289f0cc0e5caae45d1431eff11
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/utils/logging.hh

index 093d63f..e336380 100644 (file)
@@ -38,20 +38,6 @@ enum class LogLevel {
 
 log_priority LogLevelToPriority(LogLevel level);
 
-template<LogLevel> struct LogTag;
-template<> struct LogTag<LogLevel::LOG_ERROR> {
-  static constexpr const char* value = "\033[1;31m| ERROR   |\033[0m";
-};
-template<> struct LogTag<LogLevel::LOG_WARNING> {
-  static constexpr const char* value = "\033[1;33m| WARNING |\033[0m";
-};
-template<> struct LogTag<LogLevel::LOG_INFO>  {
-  static constexpr const char* value = "\033[1;32m| INFO    |\033[0m";
-};
-template<> struct LogTag<LogLevel::LOG_DEBUG> {
-  static constexpr const char* value = "\033[0m| DEBUG   |\033[0m";
-};
-
 template <class charT, class traits = std::char_traits<charT>>
 class StringStream : private std::basic_ostringstream<charT, traits> {
  public:
@@ -108,9 +94,9 @@ inline static const constexpr char* __tag_for_project() {
     ::utils::LogCatcher(                                                       \
       ::utils::LogLevel::LOG_ ## LEVEL, __tag_for_project())                   \
       & ::utils::StringStream<char>()                                          \
-      << 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_