FIoRegistry.h => iniparser.h
[platform/framework/native/appfw.git] / src / base / inc / FBase_Log.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
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 /**
18  * @file                FBase_Log.h
19  * @brief               This file is internal header for Log.
20  */
21 #ifndef _FBASE_INTERNAL_LOG_H_
22 #define _FBASE_INTERNAL_LOG_H_
23
24 #include <stdarg.h>
25 #include <FOspConfig.h>
26 #include <FBaseDataType.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif // __cplusplus
31
32 #define LOG_MODULE_NAME_LEN_MAX 30
33 #define LOG_TAG_LEN_MAX 50
34 #define LOG_LEN_MAX 1024
35 #define PROPAGATION_LEN_MAX 512
36
37 #define NID_MAX 200
38
39 /**
40  * LogEntry
41  *
42  */
43 typedef struct LogEntry
44 {
45         const int logID;
46         const char logIDName[LOG_MODULE_NAME_LEN_MAX];
47         const char logModuleName[LOG_MODULE_NAME_LEN_MAX];
48         bool loggingEnabled;
49 } LogEntry;
50
51 /**
52  * LogInfo
53  */
54 typedef struct LogInfo
55 {
56         LogEntry logTable[NID_MAX];
57
58         bool consoleOut;
59         bool fileOut;
60
61         bool platformInfoEnabled;
62         bool platformExceptionEnabled;
63
64         bool applicationInfoEnabled;
65         bool applicationDebugEnabled;
66         bool applicationExceptionEnabled;
67 } LogInfo;
68
69 /**
70  * Log Types
71  */
72 enum _LogType
73 {
74         LOG_INFO = 10,
75         LOG_DEBUG = 11,
76         LOG_EXCEPTION = 12,
77         LOG_USER = 13
78 };
79
80 void __PrintLog(_LogType type, const char* pFunction, int lineNumber, const char* pFormat, va_list args);
81 void __PrintLogTag(const char* pTag, _LogType type, const char* pFunction, int lineNumber, const char* pFormat, va_list args);
82 void __PrintSysLog(_LogType type, LogID id, const char* pFunction, int lineNumber, const char* pFormat, va_list args);
83 void __PrintSysLogTag(const char* pTag, _LogType type, LogID id, const char* pFunction, int lineNumber, const char* pFormat, va_list args);
84
85 const char* __GetModuleName(LogID id);
86 bool __GetEnableInfo(LogID id);
87
88 void __InitializeLogInfo(void);
89
90 #ifdef __cplusplus
91 }
92 #endif // __cplusplus
93 #endif // _FBASE_INTERNAL_LOG_H_