Fix exception handling about printing log 42/239942/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 31 Jul 2020 01:00:47 +0000 (10:00 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 31 Jul 2020 01:00:47 +0000 (10:00 +0900)
If the logger initialization is failed, printing log will be skipped.

Change-Id: I2e94fb628ed6cc2b42312e9d83bcbfebd5c24c3a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad/src/launchpad_log.c

index 00acc46..a8d00a3 100644 (file)
@@ -30,15 +30,9 @@ int _log_print(const char *tag, const char *format, ...)
 {
        char formatted_buf[LAUNCHPAD_LOG_MAX_STRING_SIZE];
        va_list ap;
-       int ret;
 
-       if (!__logger) {
-               ret = _logger_create(PATH_LAUNCHPAD_LOG, &__logger);
-               if (ret != 0) {
-                       _E("Failed to create log file. error(%d)", ret);
-                       return -1;
-               }
-       }
+       if (!__logger)
+               return 0;
 
        va_start(ap, format);
        vsnprintf(formatted_buf, sizeof(formatted_buf), format, ap);