Change log level for analysis 55/316155/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20241212.022106
authorJihoon Jung <jh8801.jung@samsung.com>
Wed, 11 Dec 2024 03:49:16 +0000 (12:49 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 11 Dec 2024 03:50:40 +0000 (12:50 +0900)
Change-Id: I9aaad00902393ea4307f6d605fec6b2ed3e8fb2f
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
include/mtp_debug.h
src/mtp.c [changed mode: 0755->0644]

index 678b534eeef3fd7772368c283c9e524af3c3496a..06491259aa3dd326f8d04de2f1337d53c35f7c47 100644 (file)
 #include <stdio.h>
 #include <dlog.h>
 
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "MTP_CAPI"
+#define DLOG_TAG "MTP_CAPI"
 
 #define COLOR_BLACK "\033[0;30m"
 #define COLOR_RED   "\033[0;31m"
 #define COLOR_GRAY  "\033[0;37m"
 #define COLOR_END   "\033[0;m"
 
-#define _ERR(fmt, ...) \
-       do { \
-               LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__); \
-       } while (0)
-
-#define _INFO(fmt, ...) \
-       do { \
-               LOGI(COLOR_GREEN fmt COLOR_END, ##__VA_ARGS__); \
-       } while (0)
-
-#define _WARN(fmt, ...) \
-       do { \
-               LOGI(COLOR_BROWN fmt COLOR_END, ##__VA_ARGS__); \
-       } while (0)
-
-#define _DBG(fmt, ...) \
-       do { \
-               LOGD(fmt, ##__VA_ARGS__); \
-       } while (0)
+#define _DBG(format, arg...) LOG(LOG_ERROR, DLOG_TAG, format, ##arg)
+#define _INFO(format, arg...) LOG(LOG_INFO, DLOG_TAG, format, ##arg)
+#define _WARN(format, arg...) LOG(LOG_WARN, DLOG_TAG, format, ##arg)
+#define _ERR(format, arg...) LOG(LOG_ERROR, DLOG_TAG, format, ##arg)
 
 #define _BEGIN() \
        do { \
-               LOGD(COLOR_BLUE "BEGIN >>>>" COLOR_END); \
+               _DBG(COLOR_BLUE "BEGIN >>>>" COLOR_END); \
        } while (0)
 
 #define _END() \
        do { \
-               LOGD(COLOR_BLUE "END <<<<" COLOR_END); \
+               _DBG(COLOR_BLUE "END <<<<" COLOR_END); \
        } while (0)
 
 #define cond_expr_ret(expr, val) \
old mode 100755 (executable)
new mode 100644 (file)
index 32a78f6..2bfed2d
--- a/src/mtp.c
+++ b/src/mtp.c
@@ -123,7 +123,7 @@ int mtp_get_devices(int **mtp_devices, int *device_count)
 
        ret = mtp_gdbus_manager_get_devices(mtp_devices, device_count);
 
-       TC_PRT("device count %d", *device_count);
+       _DBG("device count %d", *device_count);
 
        _END();
 
@@ -150,7 +150,7 @@ int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_count)
 
        ret = mtp_gdbus_manager_get_storages(mtp_device, mtp_storages, storage_count);
 
-       TC_PRT("storage count %d", *storage_count);
+       _DBG("storage count %d", *storage_count);
 
        _END();
 
@@ -368,7 +368,7 @@ int mtp_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_nam
 
        ret = mtp_gdbus_deviceinfo_get_manufacturer_name(mtp_device, manufacturer_name);
 
-       TC_PRT("manufacturername %s", *manufacturer_name);
+       _DBG("manufacturername %s", *manufacturer_name);
 
        _END();
 
@@ -392,7 +392,7 @@ int mtp_deviceinfo_get_model_name(int mtp_device, char **model_name)
 
        ret = mtp_gdbus_deviceinfo_get_model_name(mtp_device, model_name);
 
-       TC_PRT("modelname %s", *model_name);
+       _DBG("modelname %s", *model_name);
 
        _END();
 
@@ -416,7 +416,7 @@ int mtp_deviceinfo_get_serial_number(int mtp_device, char **serial_number)
 
        ret = mtp_gdbus_deviceinfo_get_serial_number(mtp_device, serial_number);
 
-       TC_PRT("serial number %s", *serial_number);
+       _DBG("serial number %s", *serial_number);
 
        _END();
 
@@ -440,7 +440,7 @@ int mtp_deviceinfo_get_device_version(int mtp_device, char **device_version)
 
        ret = mtp_gdbus_deviceinfo_get_device_version(mtp_device, device_version);
 
-       TC_PRT("device version %s", *device_version);
+       _DBG("device version %s", *device_version);
 
        _END();
 
@@ -465,7 +465,7 @@ int mtp_deviceinfo_get_bus_location(int mtp_device, int *bus_location)
 
        ret = mtp_gdbus_deviceinfo_get_bus_location(mtp_device, bus_location);
 
-       TC_PRT("bus location %d", *bus_location);
+       _DBG("bus location %d", *bus_location);
 
        _END();
 
@@ -490,7 +490,7 @@ int mtp_deviceinfo_get_device_number(int mtp_device, int *device_number)
 
        ret = mtp_gdbus_deviceinfo_get_device_number(mtp_device, device_number);
 
-       TC_PRT("device number %d", *device_number);
+       _DBG("device number %d", *device_number);
 
        _END();
 
@@ -515,7 +515,7 @@ int mtp_deviceinfo_get_stitching_engine_version(mtp_device_h mtp_device,
 
        ret = mtp_gdbus_deviceinfo_get_stitching_engine_version(mtp_device, stitching_engine_version);
 
-       TC_PRT("stitching engine version %s", *stitching_engine_version);
+       _DBG("stitching engine version %s", *stitching_engine_version);
 
        _END();
 
@@ -542,7 +542,7 @@ int mtp_storageinfo_get_description(int mtp_device, int mtp_storage, char **desc
 
        ret = mtp_gdbus_storageinfo_get_description(mtp_device, mtp_storage, description);
 
-       TC_PRT("description %s", *description);
+       _DBG("description %s", *description);
 
        _END();
 
@@ -567,7 +567,7 @@ int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned lon
 
        ret = mtp_gdbus_storageinfo_get_free_space(mtp_device, mtp_storage, (guint64 *)free_space);
 
-       TC_PRT("freespace %llu", *free_space);
+       _DBG("freespace %llu", *free_space);
 
        _END();
 
@@ -592,7 +592,7 @@ int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned l
 
        ret = mtp_gdbus_storageinfo_get_max_capacity(mtp_device, mtp_storage, (guint64 *)max_capacity);
 
-       TC_PRT("maxcapacity %llu", *max_capacity);
+       _DBG("maxcapacity %llu", *max_capacity);
 
        _END();
 
@@ -617,7 +617,7 @@ int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storag
 
        ret = mtp_gdbus_storageinfo_get_storage_type(mtp_device, mtp_storage, (int *)storage_type);
 
-       TC_PRT("storagetype %d", *storage_type);
+       _DBG("storagetype %d", *storage_type);
 
        _END();
 
@@ -642,7 +642,7 @@ int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char
 
        ret = mtp_gdbus_storageinfo_get_volume_identifier(mtp_device, mtp_storage, volume_identifier);
 
-       TC_PRT("volumeidentifier %s", *volume_identifier);
+       _DBG("volumeidentifier %s", *volume_identifier);
 
        _END();
 
@@ -669,7 +669,7 @@ int mtp_objectinfo_get_parent_object_handle(int mtp_device, int object_handle,
        ret = mtp_gdbus_objectinfo_get_property(mtp_device,
                object_handle, MTP_PROPERTY_PARENT_OBJECT_HANDLE, parent_object_handle);
 
-       TC_PRT("parent object id %d", *parent_object_handle);
+       _DBG("parent object id %d", *parent_object_handle);
 
        _END();