Change log buffer to system 98/100798/3
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 29 Nov 2016 08:27:00 +0000 (17:27 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 7 Dec 2016 05:59:41 +0000 (14:59 +0900)
Use SLOGs instead of LOGs

Change-Id: Id4ce90d14ceab024514b2b5da7696aca414887fc
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
src/crash-manager/crash-manager.c
src/log_dump/dbus-handler.c
src/log_dump/log_dump.c
src/log_dump/log_dump.h.in

index 80d5422ccb3b8adfbd88b3a7b82ac2c262cbd78f..473a8253c8c70a627baf29cd313ab7da0303161c 100644 (file)
@@ -33,8 +33,8 @@
 #include <gio/gio.h>
 #include <iniparser.h>
 #include <tzplatform_config.h>
-#include <dlog.h>
 #include "crash-manager.h"
+#include "shared/log.h"
 #include "shared/util.h"
 
 #undef LOG_TAG
@@ -109,27 +109,27 @@ static void get_config(void)
 
        ini = iniparser_load(CRASH_CONF_FILE);
        if (!ini) {
-               LOGE("Failed to load conf file");
+               _E("Failed to load conf file");
                return;
        }
 
        snprintf(key, sizeof(key), "%s:%s", CRASH_SECTION, "SystemMaxUse");
        value = iniparser_getint(ini, key, -1);
        if (value < 0) {
-               LOGD("Invalid value for SystemMaxUse. Use default value [ %d kbyte]",
+               _D("Invalid value for SystemMaxUse. Use default value [ %d kbyte]",
                                SYSTEM_MAX_USE);
        } else {
-               LOGD("SystemMaxUse [ %d kbyte]", value);
+               _D("SystemMaxUse [ %d kbyte]", value);
                system_max_use = value;
        }
 
        snprintf(key, sizeof(key), "%s:%s", CRASH_SECTION, "SystemKeepFree");
        value = iniparser_getint(ini, key, -1);
        if (value < 0) {
-               LOGD("Invalid value for SystemKeepFree. Use default value [ %d kbyte]",
+               _D("Invalid value for SystemKeepFree. Use default value [ %d kbyte]",
                                SYSTEM_KEEP_FREE);
        } else {
-               LOGD("SystemKeepFree [ %d kbyte]", value);
+               _D("SystemKeepFree [ %d kbyte]", value);
                system_keep_free = value;
        }
 
@@ -137,30 +137,30 @@ static void get_config(void)
        snprintf(key, sizeof(key), "%s:%s", CRASH_SECTION, "MaxRetentionSec");
        value = iniparser_getint(ini, key, -1);
        if (value < 0) {
-               LOGD("Invalid value for MaxRetentionSec. Use default value [ %d ]",
+               _D("Invalid value for MaxRetentionSec. Use default value [ %d ]",
                                MAX_RETENTION_SEC);
        } else {
-               LOGD("MaxRetentionSec [ %d ]", value);
+               _D("MaxRetentionSec [ %d ]", value);
                max_retention_sec = value;
        }
 
        snprintf(key, sizeof(key), "%s:%s", CRASH_SECTION, "MaxCrashDump");
        value = iniparser_getint(ini, key, -1);
        if (value < 0) {
-               LOGD("Invalid value for MaxCrashDump. Use default value [ %d ]",
+               _D("Invalid value for MaxCrashDump. Use default value [ %d ]",
                                MAX_CRASH_DUMP);
        } else {
-               LOGD("MaxCrashDump [ %d ]", value);
+               _D("MaxCrashDump [ %d ]", value);
                max_crash_dump = value;
        }
 
        snprintf(key, sizeof(key), "%s:%s", CRASH_SECTION, "AllowZip");
        value = iniparser_getboolean(ini, key, -1);
        if (value < 0) {
-               LOGD("Invalid value for AllowZip. Use default value [ %s ]",
+               _D("Invalid value for AllowZip. Use default value [ %s ]",
                                ALLOW_ZIP ? "true" : "false" );
        } else {
-               LOGD("AllowZip [ %s ]", value ? "true" : "false");
+               _D("AllowZip [ %s ]", value ? "true" : "false");
                allow_zip = value;
        }
 
@@ -173,12 +173,12 @@ static int make_dump_dir(void)
 
        if (!stat(CRASH_PATH, &st)) {
                if (!(st.st_mode & S_IFDIR)) {
-                       LOGE("%s (not DIR) is already exist", CRASH_PATH);
+                       _E("%s (not DIR) is already exist", CRASH_PATH);
                        return -1;
                }
        } else {
                if (mkdir(CRASH_PATH, 0775) < 0) {
-                       LOGE("Failed to mkdir for %s", CRASH_PATH);
+                       _E("Failed to mkdir for %s", CRASH_PATH);
                        return -1;
                }
                smack_setlabel(CRASH_PATH, "System::Shared",
@@ -188,12 +188,12 @@ static int make_dump_dir(void)
 
        if (!stat(CRASH_TEMP, &st)) {
                if (!(st.st_mode & S_IFDIR)) {
-                       LOGE("%s (not DIR) is already exist", CRASH_TEMP);
+                       _E("%s (not DIR) is already exist", CRASH_TEMP);
                        return -1;
                }
        } else {
                if (mkdir(CRASH_TEMP, 0775) < 0) {
-                       LOGE("Failed to mkdir for %s", CRASH_TEMP);
+                       _E("Failed to mkdir for %s", CRASH_TEMP);
                        return -1;
                }
                smack_setlabel(CRASH_TEMP, "System::Shared",
@@ -222,12 +222,12 @@ static int set_crash_info(char *argv[])
        ret = snprintf(crash_info.temp_dir, sizeof(crash_info.temp_dir),
                        "%s/crash.XXXXXX", CRASH_TEMP);
        if (ret < 0) {
-               LOGE("Failed to snprintf for temp_dir");
+               _E("Failed to snprintf for temp_dir");
                return -1;
        }
        temp_dir_ret = mkdtemp(crash_info.temp_dir);
        if (access(temp_dir_ret, F_OK)) {
-               LOGE("Failed to mkdtemp for temp_dir");
+               _E("Failed to mkdtemp for temp_dir");
                return -1;
        }
 
@@ -236,7 +236,7 @@ static int set_crash_info(char *argv[])
                        crash_info.pid_info,
                        crash_info.time_info);
        if (ret < 0) {
-               LOGE("Failed to snprintf for name");
+               _E("Failed to snprintf for name");
                goto rm_temp;
        }
 
@@ -249,40 +249,40 @@ static int set_crash_info(char *argv[])
                                sizeof(crash_info.result_path),
                                "%s/%s", CRASH_PATH, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for result path");
+               _E("Failed to snprintf for result path");
                goto rm_temp;
        }
 
        ret = snprintf(crash_info.pfx, sizeof(crash_info.pfx), "%s/%s",
                        crash_info.temp_dir, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for pfx");
+               _E("Failed to snprintf for pfx");
                goto rm_temp;
        }
        ret = mkdir(crash_info.pfx, 0775);
        if (ret < 0) {
-               LOGE("Failed to mkdir for %s", crash_info.pfx);
+               _E("Failed to mkdir for %s", crash_info.pfx);
                goto rm_temp;
        }
 
        ret = snprintf(crash_info.info_path, sizeof(crash_info.info_path),
                        "%s/%s.info", crash_info.pfx, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for info path");
+               _E("Failed to snprintf for info path");
                goto rm_temp;
        }
 
        ret = snprintf(crash_info.core_path, sizeof(crash_info.core_path),
                        "%s/%s.coredump", crash_info.pfx, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for core path");
+               _E("Failed to snprintf for core path");
                goto rm_temp;
        }
 
        ret = snprintf(crash_info.log_path, sizeof(crash_info.log_path),
                        "%s/%s.log", crash_info.pfx, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for log path");
+               _E("Failed to snprintf for log path");
                goto rm_temp;
        }
 
@@ -292,7 +292,7 @@ static int set_crash_info(char *argv[])
                       "/tmp/crash_stack/%s_%s.info",
                       crash_info.cmd_info, crash_info.pid_info);
        if (ret < 0) {
-               LOGE("Failed to snprintf for sys-assert callstack path");
+               _E("Failed to snprintf for sys-assert callstack path");
                goto rm_temp;
        }
 #endif
@@ -311,7 +311,7 @@ static int get_sysassert_cs(void)
        char move_path[PATH_MAX];
 
        if (access(crash_info.sysassert_cs_path, F_OK)) {
-               LOGE("The sys-assert cs file not found: %s",
+               _E("The sys-assert cs file not found: %s",
                        crash_info.sysassert_cs_path);
                return -1;
        }
@@ -319,12 +319,12 @@ static int get_sysassert_cs(void)
        ret = snprintf(move_path, sizeof(move_path), "%s/%s",
                        crash_info.pfx, basename(crash_info.sysassert_cs_path));
        if (ret < 0) {
-               LOGE("Failed to snprintf for move path");
+               _E("Failed to snprintf for move path");
                return -1;
        }
 
        if (move_file(crash_info.sysassert_cs_path, move_path) < 0) {
-               LOGE("Failed to move %s to %s",
+               _E("Failed to move %s to %s",
                                crash_info.sysassert_cs_path, move_path);
                return -1;
        }
@@ -355,13 +355,13 @@ static void launch_crash_popup(char *core_exepath)
        char exepath[PATH_MAX] = "\0";
 
        if (convert_path(exepath, core_exepath) <= 0) {
-               LOGE("Failed to parsing exepath");
+               _E("Failed to parsing exepath");
                return;
        }
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
        if (error) {
-               LOGE("Failed to get dbus: %s", error->message);
+               _E("Failed to get dbus: %s", error->message);
                g_error_free(error);
                return;
        }
@@ -386,13 +386,13 @@ static void launch_crash_popup(char *core_exepath)
                                            NULL,
                                            &error);
        if (error) {
-               LOGE("Failed to get reply: %s", error->message);
+               _E("Failed to get reply: %s", error->message);
                g_error_free(error);
                goto exit;
        }
 
        g_variant_get(reply, "(i)", &ret);
-       LOGI("Crash_popup is launched: (%d)", ret);
+       _I("Crash_popup is launched: (%d)", ret);
 
 exit:
        if (reply)
@@ -410,7 +410,7 @@ static void dump_system_state(void)
                        "/usr/bin/dump_systemstate -d -k -f %s",
                        crash_info.log_path);
        if (ret < 0) {
-               LOGE("Failed to snprintf for dump_systemstate command");
+               _E("Failed to snprintf for dump_systemstate command");
                return;
        }
        system_command(command);
@@ -442,7 +442,7 @@ static void execute_crash_modules(int argc, char *argv[], int debug)
                                arg_append,
                                crash_info.info_path);
        if (ret < 0) {
-               LOGE("Failed to snprintf for crash-pipe command");
+               _E("Failed to snprintf for crash-pipe command");
                return;
        }
        system_command(command);
@@ -454,7 +454,7 @@ static void execute_crash_modules(int argc, char *argv[], int debug)
                        CRASH_STACK_PATH,
                        crash_info.pid_info, crash_info.info_path);
        if (ret < 0) {
-               LOGE("Failed to snprintf for crash-stack command");
+               _E("Failed to snprintf for crash-stack command");
                return;
        }
        system_command(command);
@@ -469,15 +469,15 @@ static void dump_lock(void)
 
        while ((fd = open(LOCK_FILE, O_CREAT | O_EXCL, 0644)) < 0) {
                if (stat(LOCK_FILE, &st) < 0) {
-                       LOGE("Failed to stat lock file");
+                       _E("Failed to stat lock file");
                        return;
                }
 
                cur_time = time(NULL);
                if (st.st_mtime + LOCK_FILE_VALIDITY < cur_time) {
-                       LOGI("Lock file validity over");
+                       _I("Lock file validity over");
                        if (unlink(LOCK_FILE) < 0)
-                               LOGE("Failed to unlink %s", LOCK_FILE);
+                               _E("Failed to unlink %s", LOCK_FILE);
                        return;
                }
                sleep(LOCK_FILE_VALIDITY / 2);
@@ -488,7 +488,7 @@ static void dump_lock(void)
 static void dump_unlock(void)
 {
        if (unlink(LOCK_FILE) < 0)
-               LOGE("Failed to unlink %s", LOCK_FILE);
+               _E("Failed to unlink %s", LOCK_FILE);
 }
 
 static void compress(void)
@@ -500,27 +500,26 @@ static void compress(void)
        ret = snprintf(zip_path, sizeof(zip_path), "%s/report.zip",
                        crash_info.temp_dir);
        if (ret < 0) {
-               LOGE("Failed to snprintf for zip path");
+               _E("Failed to snprintf for zip path");
                return;
        }
 
        ret = snprintf(command, sizeof(command), "cd %s && /bin/zip -r %s %s > /dev/null 2>&1",
                        crash_info.temp_dir, zip_path, crash_info.name);
        if (ret < 0) {
-               LOGE("Failed to snprintf for zip command");
+               _E("Failed to snprintf for zip command");
                return;
        }
        system_command(command);
 
        dump_lock();
        if (rename(zip_path, crash_info.result_path) < 0)
-               LOGE("Failed to move %s to %s",
-                               zip_path, crash_info.result_path);
+               _E("Failed to move %s to %s", zip_path, crash_info.result_path);
        dump_unlock();
 
        ret = remove_dir(crash_info.temp_dir, 1);
        if (ret < 0)
-               LOGE("Failed to delete temp directory");
+               _E("Failed to delete temp directory");
 }
 
 static void move_dump_dir(void)
@@ -531,14 +530,14 @@ static void move_dump_dir(void)
        ret = rename(crash_info.pfx, crash_info.result_path);
        dump_unlock();
        if (ret < 0) {
-               LOGE("Failed to move %s to %s",
+               _E("Failed to move %s to %s",
                                crash_info.pfx, crash_info.result_path);
                return;
        }
 
        ret = remove_dir(crash_info.temp_dir, 1);
        if (ret < 0)
-               LOGE("Failed to delete temp directory");
+               _E("Failed to delete temp directory");
 }
 
 static int dump_filter(const struct dirent *de)
@@ -569,7 +568,7 @@ static int scan_dump(struct file_info **dump_list)
        int fd;
 
        if ((fd = open(CRASH_PATH, O_DIRECTORY)) < 0 ) {
-               LOGE("Failed to open %s", CRASH_PATH);
+               _E("Failed to open %s", CRASH_PATH);
                return -1;
        }
 
@@ -582,19 +581,19 @@ static int scan_dump(struct file_info **dump_list)
        temp_list = (struct file_info *)calloc(scan_num,
                        sizeof(struct file_info));
        if (!temp_list) {
-               LOGE("Failed to calloc for dump list");
+               _E("Failed to calloc for dump list");
                goto exit;
        }
 
        for (i = 0; i < scan_num; i++) {
                if (fstatat(fd, scan_list[i]->d_name, &st, 0) < 0) {
-                       LOGE("Failed to fstatat");
+                       _E("Failed to fstatat");
                        continue;
                }
 
                if (asprintf(&(temp_list[dump_num].path), "%s/%s",
                                        CRASH_PATH, scan_list[i]->d_name) < 0) {
-                       LOGE("Failed to asprintf");
+                       _E("Failed to asprintf");
                        continue;
                }
 
@@ -622,7 +621,7 @@ static int scan_dump(struct file_info **dump_list)
        qsort(temp_list, dump_num, sizeof(struct file_info), mtime_cmp);
 
        for (i = 0; i < dump_num; i++)
-               LOGD("[%d] path: %s(%s), size: %d kb, mtime: %s",
+               _D("[%d] path: %s(%s), size: %d kb, mtime: %s",
                                i,
                                temp_list[i].path,
                                temp_list[i].isdir ? "DIR" : "FILE",
@@ -651,7 +650,7 @@ static int check_disk_available(const char *path, int check_size)
        avail_size = (int)(lstatfs.f_bavail * (lstatfs.f_bsize / 1024));
 
        if (check_size > avail_size) {
-               LOGI("avail_size is (%d)", avail_size);
+               _I("avail_size is (%d)", avail_size);
                return -1;
        }
 
@@ -691,10 +690,10 @@ static void clean_dump(void)
                        dump_list[i].mtime > 0 &&
                        dump_list[i].mtime + max_retention_sec < cur_time) {
                        if (remove_file(dump_list[i]) < 0) {
-                               LOGE("Failed to remove %s", dump_list[i].path);
+                               _E("Failed to remove %s", dump_list[i].path);
                                continue;
                        }
-                       LOGI("Reached the maximum retention time %d, so remove (%s)",
+                       _I("Reached the maximum retention time %d, so remove (%s)",
                                        max_retention_sec, dump_list[i].path);
                        dump_num--;
                        next = i + 1;
@@ -707,10 +706,10 @@ static void clean_dump(void)
                        0 < dump_num && max_crash_dump < dump_num) {
                for (i = next; i < scan_num; i++) {
                        if (remove_file(dump_list[i]) < 0) {
-                               LOGE("Failed to remove %s", dump_list[i].path);
+                               _E("Failed to remove %s", dump_list[i].path);
                                continue;
                        }
-                       LOGI("Reached the maximum number of dump %d/%d, so remove (%s)",
+                       _I("Reached the maximum number of dump %d/%d, so remove (%s)",
                                        dump_num, max_crash_dump,
                                        dump_list[i].path);
                        dump_num--;
@@ -726,11 +725,11 @@ static void clean_dump(void)
                        0 < dump_num && system_max_use < usage / 1024) {
                for (i = next; i < scan_num; i++) {
                        if (remove_file(dump_list[i]) < 0) {
-                               LOGE("Failed to remove %s", dump_list[i].path);
+                               _E("Failed to remove %s", dump_list[i].path);
                                dump_num--;
                                continue;
                        }
-                       LOGI("Reached the maximum disk usage %d/%d kb, so remove (%s)",
+                       _I("Reached the maximum disk usage %d/%d kb, so remove (%s)",
                                        usage / 1024, system_max_use,
                                        dump_list[i].path);
                        dump_num--;
@@ -744,7 +743,7 @@ static void clean_dump(void)
        if (system_keep_free &&
                        check_disk_available(CRASH_CHECK_DISK_PATH,
                                             system_keep_free) < 0) {
-               LOGI("Disk is not available! so set the maximum number of dump to 1");
+               _I("Disk is not available! so set the maximum number of dump to 1");
                max_crash_dump = 1;
        }
 
index f283c4044f8a809bbbd1b948f69de8325cfbdac9..2eecde6e8922e9bd8894e481a00d9bf728ba3886 100644 (file)
@@ -53,7 +53,7 @@ static const gchar introspection_xml[] =
 
 static int timeout_cb(gpointer data)
 {
-       LOGI("Time out!");
+       _I("Time out!");
        g_main_loop_quit((GMainLoop *)data);
 
        return 0;
@@ -68,7 +68,7 @@ static void add_timeout(void)
        timeout_id = g_timeout_add_seconds(TIMEOUT_INTERVAL, timeout_cb, loop);
 
        g_mutex_unlock(&timeout_mutex);
-       LOGI("Add loop timeout (%d)", TIMEOUT_INTERVAL);
+       _I("Add loop timeout (%d)", TIMEOUT_INTERVAL);
 }
 
 static void remove_timeout(void)
@@ -81,7 +81,7 @@ static void remove_timeout(void)
        }
 
        g_mutex_unlock(&timeout_mutex);
-       LOGI("Remove loop timeout");
+       _I("Remove loop timeout");
 }
 
 static void method_call_handler(GDBusConnection *conn,
@@ -105,7 +105,7 @@ static void method_call_handler(GDBusConnection *conn,
                else if (g_strcmp0(arg, "short") == 0)
                        ret = log_dump(OPT_SHORT);
                else
-                       LOGE("Wrong option for log_dump");
+                       _E("Wrong option for log_dump");
        } else if (g_strcmp0(method_name, "delete_dump") == 0) {
                ret = delete_dump();
        }
@@ -132,21 +132,21 @@ static void on_bus_acquired(GDBusConnection *conn,
                        CRASH_OBJECT_PATH, introspection_data->interfaces[0],
                        &interface_vtable, NULL, NULL, NULL);
        if (registration_id == 0)
-               LOGE("Failed to g_dbus_connection_register_object");
+               _E("Failed to g_dbus_connection_register_object");
 }
 
 static void on_name_acquired(GDBusConnection *conn,
                             const gchar *name,
                             gpointer user_data)
 {
-       LOGD("Acquired the name %s on the system bus", name);
+       _D("Acquired the name %s on the system bus", name);
 }
 
 static void on_name_lost(GDBusConnection *conn,
                         const gchar *name,
                         gpointer user_data)
 {
-       LOGD("Lost the name %s on the system bus", name);
+       _D("Lost the name %s on the system bus", name);
 }
 
 static void dbus_init(void)
@@ -157,18 +157,18 @@ static void dbus_init(void)
        introspection_data =
                g_dbus_node_info_new_for_xml(introspection_xml, NULL);
        if (introspection_data == NULL) {
-               LOGE("Failed to init g_dbus_info_new_for_xml");
+               _E("Failed to init g_dbus_info_new_for_xml");
                return;
        }
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
        if (!conn) {
-               LOGE("Failed to get dbus");
+               _E("Failed to get dbus");
                return;
        }
 
        if (error) {
-               LOGE("Failed to get dbus: %s", error->message);
+               _E("Failed to get dbus: %s", error->message);
                g_error_free(error);
                return;
        }
@@ -187,7 +187,7 @@ int log_dump_dbus(void)
        g_mutex_init(&timeout_mutex);
        add_timeout();
 
-       LOGI("log_dump_dbus activated");
+       _I("log_dump_dbus activated");
        g_main_loop_run(loop);
 
        if (introspection_data)
@@ -203,10 +203,10 @@ static int broadcast_logdump(const char *signal)
        GDBusConnection *conn;
        GError *error = NULL;
 
-       LOGI("broadcast signal: %s", signal);
+       _I("broadcast signal: %s", signal);
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
        if (error) {
-               LOGE("Failed to get dbus: %s", error->message);
+               _E("Failed to get dbus: %s", error->message);
                g_error_free(error);
                return -1;
        }
@@ -219,7 +219,7 @@ static int broadcast_logdump(const char *signal)
                                      NULL,
                                      &error);
        if (error) {
-               LOGE("Failed to emit signal: %s", error->message);
+               _E("Failed to emit signal: %s", error->message);
                g_error_free(error);
                return -1;
        }
index ffe3c56e7124233eb923ae50e7e2beb56a16c633..16150a92250592da0cfb59af7e15ef8794e76f3f 100644 (file)
@@ -60,7 +60,7 @@ static int dump_scripts(void)
 
        script_num = scandir(DUMP_SCRIPTS_DIR, &dir_list, NULL, NULL);
        if (script_num < 0) {
-               LOGE("Failed to scandir %s",DUMP_SCRIPTS_DIR);
+               _E("Failed to scandir %s",DUMP_SCRIPTS_DIR);
                return -1;
        }
 
@@ -71,7 +71,7 @@ static int dump_scripts(void)
                snprintf(command, sizeof(command), "%s/%s %s",
                                DUMP_SCRIPTS_DIR, dir_list[i]->d_name,
                                LOG_DUMP_DIR);
-               LOGD("%s", command);
+               _D("%s", command);
                system_command(command);
        }
 
@@ -101,7 +101,7 @@ int log_dump(int option)
                ret = snprintf(command, sizeof(command),
                                "/usr/bin/mkdir -p %s", LOG_DUMP_DIR);
                if (ret < 0) {
-                       LOGE("Failed to mkdir");
+                       _E("Failed to mkdir");
                        return -1;
                }
                system_command(command);
@@ -112,7 +112,7 @@ int log_dump(int option)
                ret = snprintf(command, sizeof(command),
                                "/usr/bin/mkdir -p %s", LOG_DUMP_RESULT);
                if (ret < 0) {
-                       LOGE("Failed to mkdir");
+                       _E("Failed to mkdir");
                        return -1;
                }
                system_command(command);
@@ -127,7 +127,7 @@ int log_dump(int option)
        ret = system_info_get_platform_string(SYSTEM_INFO_KEY_BUILD_STRING,
                        &version_str);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to system_info_get_platform_string");
+               _E("Failed to system_info_get_platform_string");
                version_str = NULL;
        }
 
@@ -136,7 +136,7 @@ int log_dump(int option)
                        "/usr/bin/dump_systemstate -k -d -f "
                        "%s/dump_systemstate_%s.log", LOG_DUMP_DIR, timestr);
        if (ret < 0) {
-               LOGE("Failed to snprintf for command");
+               _E("Failed to snprintf for command");
                goto exit;
        }
        system_command(command);
@@ -149,14 +149,14 @@ int log_dump(int option)
                ret = snprintf(dump_filename, sizeof(dump_filename), "%s_%s",
                                "log_dump", version_str);
                if (ret < 0) {
-                       LOGE("Failed to snprintf for dump path");
+                       _E("Failed to snprintf for dump path");
                        goto exit;
                }
        } else {
                ret = snprintf(dump_filename, sizeof(dump_filename), "%s",
                                "log_dump");
                if (ret < 0) {
-                       LOGE("Failed to snprintf for dump path");
+                       _E("Failed to snprintf for dump path");
                        return -1;
                }
        }
@@ -164,14 +164,14 @@ int log_dump(int option)
        /* Compression */
        dump_dirname = strdup(LOG_DUMP_DIR);
        if (!dump_dirname) {
-               LOGE("Failed to strdup for dump_dirname");
+               _E("Failed to strdup for dump_dirname");
                goto exit;
        }
 
        if (option == OPT_NORMAL) {
                crash_dirname = strdup(CRASH_DUMP_DIR);
                if (!crash_dirname) {
-                       LOGE("Failed to strdup for dump_dirname");
+                       _E("Failed to strdup for dump_dirname");
                        goto exit;
                }
 
@@ -181,7 +181,7 @@ int log_dump(int option)
                                LOG_DUMP_RESULT, dump_filename, timestr,
                                basename(dump_dirname), basename(crash_dirname));
                if (ret < 0) {
-                       LOGE("Failed to snprintf for command");
+                       _E("Failed to snprintf for command");
                        goto exit;
                }
        } else {
@@ -191,7 +191,7 @@ int log_dump(int option)
                                LOG_DUMP_RESULT, dump_filename, timestr,
                                basename(dump_dirname));
                if (ret < 0) {
-                       LOGE("Failed to snprintf for command");
+                       _E("Failed to snprintf for command");
                        goto exit;
                }
        }
@@ -202,13 +202,13 @@ int log_dump(int option)
        /* Remove gatherd dump */
        ret = remove_dir(LOG_DUMP_DIR, 0);
        if (ret < 0) {
-               LOGE("Failed to delete dump directory");
+               _E("Failed to delete dump directory");
                goto exit;
        }
        if (option == OPT_NORMAL) {
                ret = remove_dir(CRASH_DUMP_DIR, 0);
                if (ret < 0) {
-                       LOGE("Failed to delete crash dump directory");
+                       _E("Failed to delete crash dump directory");
                        goto exit;
                }
        }
@@ -230,7 +230,7 @@ exit:
 
 int delete_dump(void)
 {
-       LOGI("delete_dump!");
+       _I("delete_dump!");
 
        remove_dir(LOG_DUMP_DIR, 0);
        remove_dir(LOG_DUMP_RESULT, 1);
index 0d3955583da5d3888e4f749b71fa238bb854f611..9c5cfaabdbb0a3a6a462986d5c138bc9ce664e3a 100644 (file)
@@ -20,7 +20,7 @@
 #define __LOGDUMP_H__
 
 #include <tzplatform_config.h>
-#include <dlog.h>
+#include "shared/log.h"
 #undef LOG_TAG
 #define LOG_TAG "LOG_DUMP"