-/*
- * Samsung API
- * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __ADVENTURE_LOG_H__
-#define __ADVENTURE_LOG_H__
+#ifndef __YOUR_APPLICATION_LOG_H__
+#define __YOUR_APPLICATION_LOG_H__
#include <dlog.h>
#undef LOG_TAG
-#define LOG_TAG "ADVENTURE"
+#define LOG_TAG "YOUR_APPLICATION"
+
+#define COLOR_RED "\033[0;40;31m"
+#define COLOR_LIGHTBLUE "\033[1;40;34m"
+#define COLOR_YELLOW "\033[1;40;33m"
+#define COLOR_END "\033[0;m"
+#define COLOR_GRAY "\033[1;40;30m"
+#define COLOR_MAGENTA "\033[1;35m"
#if !defined(_D)
-#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, fmt"\n", ##arg)
+#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, COLOR_YELLOW fmt COLOR_END"\n", ##arg)
#endif
#if !defined(_W)
-#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, fmt"\n", ##arg)
+#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, COLOR_GRAY fmt COLOR_END"\n", ##arg)
#endif
#if !defined(_E)
-#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, fmt"\n", ##arg)
+#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, COLOR_RED fmt COLOR_END"\n", ##arg)
#endif
#define retv_if(expr, val) do { \
} \
}
-#endif /* __ADVENTURE_LOG_H__ */
+#endif /* __YOUR_APPLICATION_LOG_H__ */
int ret = SQLITE_OK;
path = app_get_data_path();
- retv_if(!path, APPL_ERROR_FAIL);
+ retv_if(!path, NULL);
snprintf(db_file, sizeof(db_file), "%s/%s", path, APP_DB_FILE);
count = sizeof(TABLES) / sizeof(char *);
for (; i < count; i++) {
_D("Drop a table[%s]", TABLES[i]);
- break_if(db_exec(TABLES[i]) != APPL_ERROR_NONE);
+ break_if(db_exec(db, TABLES[i]) != APPL_ERROR_NONE);
}
return APPL_ERROR_FAIL;