if (state == S_LCDOFF)
set_process_active(true, pid);
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
+ CRITICAL_LOG("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(false, pid);
- _I("[%s] unlocked by %5d", states[state].name, pid);
+ CRITICAL_LOG("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(true, pid);
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
+ CRITICAL_LOG("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(false, pid);
- _I("[%s] unlocked by %5d", states[state].name, pid);
+ CRITICAL_LOG("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(true, pid);
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
+ CRITICAL_LOG("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(false, pid);
- _I("[%s] unlocked by %5d", states[state].name, pid);
+ CRITICAL_LOG("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(true, pid);
- _I("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
+ CRITICAL_LOG("[%s] locked by %5d with %u ms", states[state].name, pid, data->timeout);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
if (state == S_LCDOFF)
set_process_active(false, pid);
- _I("[%s] unlocked by %5d", states[state].name, pid);
+ CRITICAL_LOG("[%s] unlocked by %5d", states[state].name, pid);
/* for debug */
if (state == S_LCDOFF)
lock_type = PM_LCDOFF_STR;
int battery_power_off_act(void *data)
{
+ CRITICAL_LOG("Low battery power off.");
return power_execute(POWER_POWEROFF);
}
prev = str;
_D("System_event: %s", str);
+ CRITICAL_LOG("Battery %s.", str);
event_system_send(SYS_EVENT_BATTERY_LEVEL_STATUS,
EVT_KEY_BATTERY_LEVEL_STATUS, str);
}
if (battery.health != HEALTH_LOW && battery.health != HEALTH_HIGH)
return G_SOURCE_REMOVE;
- _I("Popup: Battery health status is not good.");
+ CRITICAL_LOG("Popup: Battery health status is not good, %s.", battery.health_s);
device_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health);
battery_pm_change_internal(INTERNAL_LOCK_POPUP, LCD_DIM);
if (disp_plgn.pm_unlock_internal)
str = EVT_VAL_BATTERY_CHARGER_CHARGING;
break;
case CHARGE_STATUS_FULL:
+ str = EVT_VAL_BATTERY_CHARGER_DISCHARGING;
+ CRITICAL_LOG("Battery %s", str);
+ break;
case CHARGE_STATUS_DISCHARGING:
str = EVT_VAL_BATTERY_CHARGER_DISCHARGING;
break;
case CHARGE_STATUS_CONNECTED:
str = EVT_VAL_BATTERY_CHARGER_CONNECTED;
+ CRITICAL_LOG("Battery %s", str);
break;
case CHARGE_STATUS_DISCONNECTED:
str = EVT_VAL_BATTERY_CHARGER_DISCONNECTED;
+ CRITICAL_LOG("Battery %s", str);
break;
default:
_E("Invalid parameter: %d", state);
static void update_present(enum battery_noti_status status)
{
- _I("Charge(%d) present(%d)", battery.charge_now, battery.present);
+ CRITICAL_LOG("Charge(%d) present(%d)", battery.charge_now, battery.present);
if (status == DEVICE_NOTI_ON) {
battery_pm_change_internal(INTERNAL_LOCK_POPUP, LCD_DIM);
static void update_health(enum battery_noti_status status)
{
_I("Charge(%d) health(%d)", battery.charge_now, battery.health);
+ CRITICAL_LOG("Popup: Battery health status is not good, %s.", battery.health_s);
if (status == DEVICE_NOTI_ON) {
- _I("Popup: Battery health status is not good.");
battery_pm_change_internal(INTERNAL_LOCK_POPUP, LCD_DIM);
if (disp_plgn.pm_change_internal)
disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_DIM);
if (ret == 0 && val != chg_on) {
battery.charger_charging = val;
ret = sys_set_int(CHARGER_CHARGE_ON_NODE, battery.charger_charging);
+ CRITICAL_LOG("chg_on changed to %d %s", battery.charger_charging,
+ (ret == 0) ? "success" : "fail");
_I("%s to change status with %d.", ((ret == 0) ? "success" : "fail"), battery.charger_charging);
} else {
_I("Skip change status with %d (ret %d prev %d)", val, ret, battery.charger_charging);
static void launch_health_popup(void)
{
- _I("Popup - Health is not good(health %s)", (battery.health == HEALTH_HIGH) ? "TempHigh" : "TempLow");
+ CRITICAL_LOG("Popup: Battery health status is not good, %s.", battery.health_s);
health_popup_timer_init(__func__);
device_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health);
battery_pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
static void sig_usr1(int signo)
{
- _D("Received SIGUSR1 signal(%d), deviced'll be finished.", signo);
+ CRITICAL_LOG("Received SIGUSR1 signal(%d), deviced'll be finished.", signo);
if (mainloop && g_main_loop_is_running(mainloop))
g_main_loop_quit(mainloop);
}
int ret;
dbus_handle_h handle = NULL;
+ CRITICAL_LOG("Initializing deviced.");
mainloop = g_main_loop_new(NULL, FALSE);
ret = check_power_flag();
g_timeout_add_seconds_full(G_PRIORITY_HIGH, WATCHDOG_TIMEOUT, watchdog_cb, NULL, NULL);
/* g_main_loop */
+ CRITICAL_LOG("Starting deviced.");
g_main_loop_run(mainloop);
g_main_loop_unref(mainloop);
_E("System session is not ready yet.");
return;
}
- _I("System session is ready.");
+ CRITICAL_LOG("System session is ready.");
device_notify_once(DEVICE_NOTIFIER_BOOTING_DONE, &system_done);
} else if (strcmp(name, SYSTEMD_DBUS_SIGNAL_USER_STARTUP_FINISHED) == 0) {
static void poweroff_request_shutdown(void)
{
- _I("Requested power off via systemd.");
const char *method;
return;
}
+ CRITICAL_LOG("Requested %s via systemd.", method);
dbus_handle_method_sync_timeout(SYSTEMD_DBUS_DEST,
SYSTEMD_DBUS_PATH,
SYSTEMD_DBUS_IFACE_MANAGER,
{
int off = poweroff_opt.type;
+ if (off == POWEROFF_TYPE_POWEROFF)
+ CRITICAL_LOG("Prepare PowerOff.");
+ else if (off == POWEROFF_TYPE_REBOOT)
+ CRITICAL_LOG("Prepare Reboot.");
+
poweroff_notify_resourced();
disable_systemd_journald();
disable_coredump_handler();
disable_display();
+
device_notify(DEVICE_NOTIFIER_POWEROFF, &off);
}
if (ret < 0)
goto out;
- _I("Poweroff PID(%d) requests %s.", ret, type_str);
+ CRITICAL_LOG("Poweroff PID(%d) requests %s.", ret, type_str);
ret = power_execute_pid(type_str, NULL);
out:
if (ret < 0)
goto out;
- _I("Poweroff PID(%d) requests type=%s option=%s.", ret, type, option);
+ CRITICAL_LOG("Poweroff PID(%d) requests type=%s option=%s.", ret, type, option);
ret = power_execute_pid(type, option);
out:
pid = (pid_t)ret;
- _D("add_poweroff_timer pid=%d", pid);
+ CRITICAL_LOG("PID %d request poweroff timer.", pid);
DD_LIST_FOREACH(poweroff_handles, l, handle) {
if (handle->pid == pid)
#ifdef ENABLE_DLOG
#include <dlog.h>
+/* critical log */
+#define CRITICAL_LOG(fmt, arg...) \
+ do { CRITICAL_LOG_(LOG_ID_SYSTEM, DLOG_INFO, LOG_TAG, fmt, ##arg); } while (0)
+
#define _D(fmt, arg...) \
do { SLOGD(fmt, ##arg); } while (0)
#define _I(fmt, arg...) \