4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
21 #ifndef __TCORE_LOG_H__
22 #define __TCORE_LOG_H__
26 #ifdef FEATURE_DLOG_DEBUG
31 #define TCORE_LOG_TAG "UNKNOWN"
34 #define info(fmt,args...) { RLOG(LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); }
35 #define msg(fmt,args...) { RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); }
36 #define dbg(fmt,args...) { RLOG(LOG_DEBUG, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); }
37 #define warn(fmt,args...) { RLOG(LOG_WARN, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); }
38 #define err(fmt,args...) { RLOG(LOG_FATAL, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); }
42 #define ANSI_COLOR_NORMAL "\e[0m"
44 #define ANSI_COLOR_BLACK "\e[0;30m"
45 #define ANSI_COLOR_RED "\e[0;31m"
46 #define ANSI_COLOR_GREEN "\e[0;32m"
47 #define ANSI_COLOR_BROWN "\e[0;33m"
48 #define ANSI_COLOR_BLUE "\e[0;34m"
49 #define ANSI_COLOR_MAGENTA "\e[0;35m"
50 #define ANSI_COLOR_CYAN "\e[0;36m"
51 #define ANSI_COLOR_LIGHTGRAY "\e[0;37m"
53 #define ANSI_COLOR_DARKGRAY "\e[1;30m"
54 #define ANSI_COLOR_LIGHTRED "\e[1;31m"
55 #define ANSI_COLOR_LIGHTGREEN "\e[1;32m"
56 #define ANSI_COLOR_YELLOW "\e[1;33m"
57 #define ANSI_COLOR_LIGHTBLUE "\e[1;34m"
58 #define ANSI_COLOR_LIGHTMAGENTA "\e[1;35m"
59 #define ANSI_COLOR_LIGHTCYAN "\e[1;36m"
60 #define ANSI_COLOR_WHITE "\e[1;37m"
62 #ifndef TCORE_LOG_FILE
63 #define TCORE_LOG_FILE stdout
66 #ifndef TCORE_LOG_FUNC
67 #define TCORE_LOG_FUNC fprintf
70 #define info(fmt,args...) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);
71 #define msg(fmt,args...) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);
72 #define dbg(fmt,args...) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);
73 #define warn(fmt,args...) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_YELLOW "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);
74 #define err(fmt,args...) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);