report-json-serializer: app and top serializers
[apps/native/ttsd-worker-task.git] / src / log.h
1 /*
2 * Copyright 2018  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (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
7 *
8 * http://floralicense.org/license/
9 *
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.
15 */
16
17 #ifndef __LOG_H__
18 #define __LOG_H__
19
20 #include <dlog.h>
21
22 /**
23  * @addtogroup Utils
24  * @{
25  */
26
27 #ifdef LOG_TAG
28         #undef LOG_TAG
29 #endif
30
31 /** @brief app default dlog tag */
32 #define LOG_TAG "TTS-TASK-WORKER"
33
34 /** @brief macro for getting information about source file */
35 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
36
37 #if !defined(DBG)
38 /** Prints debug level information to dlog */
39 #define DBG(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
40 #endif
41
42 #if !defined(WRN)
43 /** Prints warning level information to dlog */
44 #define WRN(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
45 #endif
46
47 #if !defined(ERR)
48 /** Prints error level information to dlog */
49 #define ERR(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
50 #endif
51
52 #if !defined(INF)
53 /** Prints info level information to dlog */
54 #define INF(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
55 #endif
56
57 #if !defined(FATAL)
58 /** Prints fatal level information to dlog */
59 #define FAT(fmt, arg...) dlog_print(DLOG_FATAL, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg);
60 #endif
61
62 /**
63  * @}
64  */
65
66 #endif