First public contribution.
1 // Copyright (c) 2008-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 // #define _HOST_DEBUG_TRACE_
26 // #define _PROXY_DEBUG_PRINT_
27 // #define _PROXY_FN_TRACE_
29 #if defined(_PROXY_FN_TRACE_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
30 #define FUNCTION_TRACE_ENABLED
33 #if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
37 #ifdef FUNCTION_TRACE_ENABLED
39 Logging function to be used with static functions. Prints the function string on
40 function entry and exit.
45 static const TInt KLogBufferSize = 0xFF;
47 TLogStaticFn(const TDesC8& aFunctionName);
52 TBuf8<KLogBufferSize> buf;
58 Logging function which prints the function string on function entry and exit.
63 static const TInt KLogBufferSize = 0xFF;
64 TLogFn(const TDesC8& aFunctionName, void* aThisPointer);
69 TBuf8<KLogBufferSize> buf;
74 #define __MSFNLOG TLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
75 #define __MSFNSLOG TLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
76 #else // FUNCTION_TRACE_ENABLED
79 #endif // FUNCTION_TRACE_ENABLED
82 #if defined (_PROXY_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
83 #define __PXYPRINT(t) {RDebug::Print(t);}
84 #define __PXYPRINT1(t,a) {RDebug::Print(t,a);}
85 #define __PXYPRINT2(t,a,b) {RDebug::Print(t,a,b);}
86 #define __PXYPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
87 #define __PXYPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
88 #define __PXYPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
89 #define __PXYPRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}
90 #define __PXYPRINT1TEMP(t,a) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}
93 #define __PXYPRINT1(t,a)
94 #define __PXYPRINT2(t,a,b)
95 #define __PXYPRINT3(t,a,b,c)
96 #define __PXYPRINT4(t,a,b,c,d)
97 #define __PXYPRINT5(t,a,b,c,d,e)
98 #define __PXYPRINT8BIT1(t,a)
99 #define __PXYPRINT1TEMP(t,a)
100 #endif // _PROXY_DEBUG_PRINT_
102 #if defined(_HOST_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
103 #define __HOSTPRINT(t) {RDebug::Print(t);}
104 #define __HOSTPRINT1(t,a) {RDebug::Print(t,a);}
105 #define __HOSTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
106 #define __HOSTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
107 #define __HOSTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
108 #define __HOSTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
109 #define __HOSTPRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}
110 #define __HOSTPRINT1TEMP(t,a) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}
111 static const TUint KBlockSize = 0x200;
113 #define __HOSTPRINT(t)
114 #define __HOSTPRINT1(t,a)
115 #define __HOSTPRINT2(t,a,b)
116 #define __HOSTPRINT3(t,a,b,c)
117 #define __HOSTPRINT4(t,a,b,c,d)
118 #define __HOSTPRINT5(t,a,b,c,d,e)
119 #define __HOSTPRINT8BIT1(t,a)
120 #define __HOSTPRINT1TEMP(t,a)
121 #endif // _HOST_DEBUG_PRINT_
123 #endif // PXY_DEBUG_H