Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This header contains definitions for logging commands.
25 #ifndef __OCSP_LOG_H__
26 #define __OCSP_LOG_H__
35 #define DEBUG_PRINTF(a) {OCSP::DebugPrintf(__LINE__, __FILE__, a);}
36 #define DEBUG_PRINTF2(a, b) {OCSP::DebugPrintf(__LINE__, __FILE__, a, b);}
37 #define DEBUG_PRINTF3(a, b, c) {OCSP::DebugPrintf(__LINE__, __FILE__, a, b, c);}
38 #define DEBUG_PRINTF4(a, b, c, d) {OCSP::DebugPrintf(__LINE__, __FILE__, a, b, c, d);}
39 #define DEBUG_PRINTF5(a, b, c, d, e) {OCSP::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);}
41 #define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; })
43 // UTF-8 overload of the DebufPrintf method. Should be used by default,
44 // since it's cheaper both in CPU cycles and stack space.
46 inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC8> aFormat, ...)
49 VA_START(list, aFormat);
55 _LIT8(KSwiLogPrefix, "[OCSP] ");
56 _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- ");
57 buffer.Append(KSwiLogPrefix);
58 buffer.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile);
59 buffer.AppendFormatList(aFormat, list);
60 buffer.Append(_L8("\r\n"));
62 RDebug::RawPrint(buffer);
67 // Unicode DebufPrintf overload
69 inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC16> aFormat, ...)
72 VA_START(list, aFormat);
78 _LIT8(KSwiLogPrefix, "[SWI] ");
79 _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- ");
80 header.Append(KSwiLogPrefix);
81 header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile);
85 buffer.AppendFormatList(aFormat, list);
86 buffer.Append(_L("\r\n"));
88 RDebug::RawPrint(buffer);
95 #define DEBUG_PRINTF(a)
96 #define DEBUG_PRINTF2(a, b)
97 #define DEBUG_PRINTF3(a, b, c)
98 #define DEBUG_PRINTF4(a, b, c, d)
99 #define DEBUG_PRINTF5(a, b, c, d, e)
101 #define DEBUG_CODE_SECTION(a)
108 #endif // __OCSP_LOG_H__