2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file installer_log.h
18 * @author Sungsu Kim(sung-su.kim@samsung.com)
23 #ifndef INSTALLER_LOG_H
24 #define INSTALLER_LOG_H
29 #include <dpl/log/secure_log.h>
31 #ifdef WRT_INSTALLER_LOG
34 #define COLOR_WARNING "\e[0m"
36 #define COLOR_TAG "\e[0m"
42 #define PKGMGR_FOTA_PATH "/opt/share/packages/.recovery/fota/"
43 #define FOTA_RESULT_FILE PKGMGR_FOTA_PATH"result.txt"
45 #define _FLOG(prio, fmt, arg...) do { \
48 __file = fopen(FOTA_RESULT_FILE, "a");\
49 if (__file == NULL) break;\
50 fprintf(__file, "[PKG_FOTA] [wrt-installer] [%s] [%s:%d] "fmt"\n", prio, __FUNCTION__, __LINE__, ##arg); \
52 __fd = fileno(__file);\
58 #define _D(fmt, arg ...) _FLOG("D", fmt, ##arg)
61 #define _W(fmt, arg ...) _FLOG("W", fmt, ##arg)
64 #define _E(fmt, arg ...) _FLOG("E", fmt, ##arg)
68 #endif // INSTALLER_LOG_H