e_log: add ELOGFD and ELOGFE
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 21 Jun 2023 07:38:38 +0000 (16:38 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Thu, 29 Jun 2023 02:29:04 +0000 (11:29 +0900)
support formatted error and debug log message

Change-Id: I42fe345df297fa53f2756c525dece9cd82c79ae1

src/bin/e_log.h

index 4393b2c..3058ffe 100644 (file)
               (t), ##x);                                    \
      }                                                      \
    while (0)
+
+#  define ELOGFD(t, f, ec, x...)                            \
+   do                                                       \
+     {                                                      \
+        if (ec)                                             \
+          DBG("EWL|%20.20s|w:0x%08zx|ec:%8p|"f,             \
+              (t), (e_client_util_win_get(ec)), (ec), ##x); \
+        else                                                \
+          DBG("EWL|%20.20s|            |             |"f,   \
+              (t), ##x);                                    \
+     }                                                      \
+   while (0)
+
+#  define ELOGFE(t, f, ec, x...)                            \
+   do                                                       \
+     {                                                      \
+        if (ec)                                             \
+          ERR("EWL|%20.20s|w:0x%08zx|ec:%8p|"f,             \
+              (t), (e_client_util_win_get(ec)), (ec), ##x); \
+        else                                                \
+          ERR("EWL|%20.20s|            |             |"f,   \
+              (t), ##x);                                    \
+     }                                                      \
+   while (0)
 # else /* old version */
 #  define ELOG(t, cp, ec)                                   \
    do                                                       \
               (t), ##x);                                    \
      }                                                      \
    while (0)
+
+#  define ELOGFD(t, f, cp, ec, x...)                        \
+   do                                                       \
+     {                                                      \
+        if (ec)                                             \
+          DBG("EWL|%20.20s|w:0x%08zx|ec:%8p|"f,             \
+              (t), (e_client_util_win_get(ec)), (ec), ##x); \
+        else                                                \
+          DBG("EWL|%20.20s|            |             |"f,   \
+              (t), ##x);                                    \
+     }                                                      \
+   while (0)
+
+#  define ELOGFE(t, f, cp, ec, x...)                        \
+   do                                                       \
+     {                                                      \
+        if (ec)                                             \
+          ERR("EWL|%20.20s|w:0x%08zx|ec:%8p|"f,             \
+              (t), (e_client_util_win_get(ec)), (ec), ##x); \
+        else                                                \
+          ERR("EWL|%20.20s|            |             |"f,   \
+              (t), ##x);                                    \
+     }                                                      \
+   while (0)
 # endif /* end of if (E_LOGGING >= 2) */
 
 typedef enum _E_Log_Type