aac69ef95ad63d7c8adfe9f7d9519a0c0b6093c1
[framework/telephony/tel-plugin-socket_communicator.git] / common / include / sipc_log.h
1 /*
2  * tel-plugin-socket-communicator
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  */
20
21 #ifndef __TPAPI_LOG_H__
22 #define __TPAPI_LOG_H__
23
24 __BEGIN_DECLS
25
26 #define ANSI_COLOR_NORMAL "\e[0m"
27
28 #define ANSI_COLOR_BLACK "\e[0;30m"
29 #define ANSI_COLOR_RED "\e[0;31m"
30 #define ANSI_COLOR_GREEN "\e[0;32m"
31 #define ANSI_COLOR_BROWN "\e[0;33m"
32 #define ANSI_COLOR_BLUE "\e[0;34m"
33 #define ANSI_COLOR_MAGENTA "\e[0;35m"
34 #define ANSI_COLOR_CYAN "\e[0;36m"
35 #define ANSI_COLOR_LIGHTGRAY "\e[0;37m"
36
37 #define ANSI_COLOR_DARKGRAY "\e[1;30m"
38 #define ANSI_COLOR_LIGHTRED "\e[1;31m"
39 #define ANSI_COLOR_LIGHTGREEN "\e[1;32m"
40 #define ANSI_COLOR_YELLOW "\e[1;33m"
41 #define ANSI_COLOR_LIGHTBLUE "\e[1;34m"
42 #define ANSI_COLOR_LIGHTMAGENTA "\e[1;35m"
43 #define ANSI_COLOR_LIGHTCYAN "\e[1;36m"
44 #define ANSI_COLOR_WHITE "\e[1;37m"
45
46 #ifndef TELEPHONY_LOG_FILE
47 #define TELEPHONY_LOG_FILE stdout
48 #endif
49 #if 0
50 #define msg(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, fmt "\n", ##args); fflush(TELEPHONY_LOG_FILE); }
51 #define dbg(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
52 #define warn(fmt,args...) { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_YELLOW "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
53 #define err(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
54 #endif
55
56 __END_DECLS
57
58 #endif