log: add critical-log type of error 34/275934/3
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 7 Jun 2022 04:41:27 +0000 (13:41 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 7 Jun 2022 05:09:03 +0000 (14:09 +0900)
Change-Id: I4e7abb62edafc719decd2d9f9e6841de46e0fbf7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/wearable/display/core.c
src/power-command/command.c
src/power/power.c
src/shared/log-macro.h
src/usb-gadget/usb-gadget-ops.c
src/usb-gadget/usb-gadget.c

index 5b640a3..e29e170 100644 (file)
@@ -430,7 +430,7 @@ static gboolean pmlock_terminate_daemon_to_release_lock(gpointer data)
                        *pname ? pname : "Unknown", pid, states[state].name, KILLABLE_DAEMON_LOCK_LIMIT);
                ret = kill(pid, SIGTERM);
                if (ret < 0)
-                       CRITICAL_LOG("Failed to send SIGTERM to process %s(%d), %d.",
+                       CRITICAL_LOG_E("Failed to send SIGTERM to process %s(%d), %d.",
                                *pname ? pname : "Unknown", pid, errno);
 
                node->force_release = true;
@@ -444,7 +444,7 @@ static gboolean pmlock_terminate_daemon_to_release_lock(gpointer data)
 
                        ret = kill(pid, SIGKILL);
                        if (ret < 0)
-                               CRITICAL_LOG("Failed to kill process %s(%d), %d.",
+                               CRITICAL_LOG_E("Failed to kill process %s(%d), %d.",
                                        *pname ? pname : "Unknown", pid, errno);
                }
 
index 868a666..f50df67 100644 (file)
@@ -79,7 +79,7 @@ static bool deviced_call_poweroff_once(const char *action, const char *extra_opt
                : gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME, DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF, "PowerOff", g_variant_new("(s)", action), NULL)
        ;
        if (ret_dbus < 0) {
-               CRITICAL_LOG("Error while calling deviced: %d", ret_dbus);
+               CRITICAL_LOG_E("Error while calling deviced: %d", ret_dbus);
                return false;
        } else
                CRITICAL_LOG("Succesfully requested shutdown using deviced");
@@ -109,7 +109,7 @@ static bool deviced_call_poweroff(const char *action, const char *extra_option)
                        break;
        }
 
-       CRITICAL_LOG("Failed to shutdown system using deviced - falling back to systemd shutdown");
+       CRITICAL_LOG_E("Failed to shutdown system using deviced - falling back to systemd shutdown");
        return false;
 }
 
index 79c8a08..793a4a0 100644 (file)
@@ -250,7 +250,7 @@ static int power_transition_state(void *data)
        if (!delayed_init_done && !is_poweroff_state(ti->next)) {
                struct trans_info *deferred_ti = calloc(1, sizeof(struct trans_info));
                if (!deferred_ti) {
-                       CRITICAL_LOG("Failed to defer transition.");
+                       CRITICAL_LOG_E("Failed to defer transition.");
                        return 0;
                }
 
index 440300f..fe998b9 100644 (file)
 #ifdef CRITICAL_LOG_ON
 #define CRITICAL_LOG(fmt, arg...) \
        do { CRITICAL_LOG_(LOG_ID_SYSTEM, DLOG_INFO, LOG_TAG, fmt, ##arg); } while (0)
+#define CRITICAL_LOG_E(fmt, arg...) \
+       do { CRITICAL_LOG_(LOG_ID_SYSTEM, DLOG_ERROR, LOG_TAG, fmt, ##arg); } while (0)
 #else
-#define CRITICAL_LOG(fmt, arg...)      _I(fmt, ##arg)
+#define CRITICAL_LOG(fmt, arg...)   _I(fmt, ##arg)
+#define CRITICAL_LOG_E(fmt, arg...) _E(fmt, ##arg)
 #endif
 
 #define _D(fmt, arg...) \
index 6d7872c..cfc29cb 100644 (file)
@@ -513,7 +513,7 @@ int usb_gadget_ops_init(void)
                        &__usb_gadget_disable,
                        &__usb_gadget_reconfigure);
        } else {
-               CRITICAL_LOG("Usb-gadget is not supported.");
+               CRITICAL_LOG_E("Usb-gadget is not supported.");
                return -ENOTSUP;
        }
 
@@ -521,7 +521,7 @@ int usb_gadget_ops_init(void)
        if (__usb_gadget_open) {
                ret = __usb_gadget_open();
                if (ret != 0) {
-                       CRITICAL_LOG("Failed to open usb-gadget, %d", ret);
+                       CRITICAL_LOG_E("Failed to open usb-gadget, %d", ret);
                        return ret;
                }
        }
index 6b01ae5..1a0769c 100644 (file)
@@ -286,7 +286,7 @@ static void usb_init(void *data)
 
        ret = usb_gadget_ops_init();
        if (ret < 0) {
-               CRITICAL_LOG("USB client cannot be used: %d", ret);
+               CRITICAL_LOG_E("USB client cannot be used: %d", ret);
                return;
        }