|
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Purpose: Defines logging marcos for XmlLib component. |
|
15 // If logging is required in the Xml parser, the appropriate macros from LogDef.h are used. Otherwise, |
|
16 // empty marcos are defined. |
|
17 // |
|
18 // |
|
19 |
|
20 #ifndef __XMLLOG_H_ |
|
21 #define __XMLLOG_H_ |
|
22 |
|
23 //#define __XML_LOGGING |
|
24 |
|
25 #if !defined (__WAPLOG_H__) |
|
26 #include "waplog.h" |
|
27 #endif |
|
28 |
|
29 #if !defined (__LOGDEF_H__) |
|
30 #include "logdef.h" // Provides logging capabilities |
|
31 #endif |
|
32 |
|
33 #if defined (__XML_LOGGING) |
|
34 // Non-empty macros |
|
35 #define __XML_DECLARE_LOG __DECLARE_LOG |
|
36 #define __XML_OPEN_LOG(aLogName) __OPEN_LOG(aLogName) |
|
37 #define __XML_OPEN_CLEANLOG(aLogName) __OPEN_CLEANLOG(aLogName) |
|
38 #define __XML_CLOSE_LOG __CLOSE_LOG |
|
39 #define __XML_PUSHLOGL __PUSHLOGL |
|
40 #define __XML_POPLOG __POPLOG |
|
41 #define __XML_LOG_ENTER(aText) __LOG_ENTER(aText) |
|
42 #define __XML_LOG_RETURN __LOG_RETURN |
|
43 #define __XML_LOG(aText) __LOG(aText) |
|
44 #define __XML_LOG1(aText,aV1) __LOG1(aText,aV1) |
|
45 #define __XML_LOGX(aLevel,aText) __LOGX(aLevel,aText) |
|
46 #define __XML_LOGX1(aLevel,aText,aV1) __LOGX1(aLevel,aText,aV1) |
|
47 #define __XML_PROFILELOG(aText) __PROFILELOG(aText) |
|
48 #define __XML_PROFILELOG1(aText,aV1) __PROFILELOG1(aText,aV1) |
|
49 #define __XML_TRACELOG(aText) __TRACELOG(aText) |
|
50 #define __XML_TRACELOG1(aText,aV1) __TRACELOG1(aText,aV1) |
|
51 #define __XML_QINFO(aText) __QINFO(aText) |
|
52 #define __XML_ENABLE_LOGRDEBUG() __ENABLE_LOGRDEBUG() |
|
53 #define __XML_DISABLE_LOGRDEBUG() __DISABLE_LOGRDEBUG() |
|
54 |
|
55 #else |
|
56 // Empty macros for non-logging builds |
|
57 #define __XML_DECLARE_LOG |
|
58 #define __XML_OPEN_LOG(aLogName) |
|
59 #define __XML_OPEN_CLEANLOG(aLogName) |
|
60 #define __XML_CLOSE_LOG |
|
61 #define __XML_PUSHLOGL |
|
62 #define __XML_POPLOG |
|
63 #define __XML_LOG_ENTER(aText) |
|
64 #define __XML_LOG_RETURN |
|
65 #define __XML_LOG(aText) |
|
66 #define __XML_LOG1(aText,aV1) |
|
67 #define __XML_LOGX(aLevel,aText) |
|
68 #define __XML_LOGX1(aLevel,aText,aV1) |
|
69 #define __XML_PROFILELOG(aText) |
|
70 #define __XML_PROFILELOG1(aText,aV1) |
|
71 #define __XML_TRACELOG(aText) |
|
72 #define __XML_TRACELOG1(aText,aV1) |
|
73 #define __XML_QINFO(aText) |
|
74 #define __XML_ENABLE_LOGRDEBUG() |
|
75 #define __XML_DISABLE_LOGRDEBUG() |
|
76 #endif |
|
77 |
|
78 #if defined (__LOGGING) && defined (_DEBUG) && defined (__EXTENDED_LOGGING_XML) && defined (__XML_LOGGING) |
|
79 #define __XML_EXT_LOG_ENTER(aText) {CXmlParser& parser = REINTERPRET_CAST(CXmlParser&, aParser);if(parser.iLogPtr != NULL) parser.iLogPtr->LogEnter(aText,CLogClient::ELogProfile); } |
|
80 #define __XML_EXT_LOG_RETURN {CXmlParser& parser = REINTERPRET_CAST(CXmlParser&, aParser);if(parser.iLogPtr != NULL) parser.iLogPtr->LogReturn(); } |
|
81 #define __XML_EXT_LOG1(aText,aV1) {CXmlParser& parser = REINTERPRET_CAST(CXmlParser&, aParser);if(parser.iLogPtr != NULL) parser.iLogPtr->Log(CLogClient::ELogLight,aText,aV1);} |
|
82 #else |
|
83 #define __XML_EXT_LOG_ENTER(aText) |
|
84 #define __XML_EXT_LOG_RETURN |
|
85 #define __XML_EXT_LOG1(aText,aV1) |
|
86 #endif |
|
87 |
|
88 #endif // __XMLLOG_H_ |