32
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "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".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: This file defines logging macros for ObexUtils
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef OBEXUTILS_DEBUG_H
|
|
20 |
#define OBEXUTILS_DEBUG_H
|
|
21 |
|
|
22 |
|
|
23 |
#ifdef _DEBUG
|
|
24 |
|
|
25 |
#include <e32svr.h>
|
|
26 |
#include <e32std.h>
|
|
27 |
#include <f32file.h>
|
|
28 |
#include <flogger.h>
|
|
29 |
|
|
30 |
_LIT(KLogFile,"obexutils.txt");
|
|
31 |
_LIT(KLogDirFullName,"c:\\logs\\");
|
|
32 |
_LIT(KLogDir,"obexutils");
|
|
33 |
|
|
34 |
// Declare the FPrint function
|
|
35 |
inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
|
|
36 |
{
|
|
37 |
VA_LIST list;
|
|
38 |
VA_START(list,aFmt);
|
|
39 |
RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
|
|
40 |
}
|
|
41 |
|
|
42 |
// ===========================================================================
|
|
43 |
#ifdef __WINS__ // File logging for WINS
|
|
44 |
// ===========================================================================
|
|
45 |
#define FLOG(a) { FPrint(a); }
|
|
46 |
#define FTRACE(a) { a; }
|
|
47 |
// ===========================================================================
|
|
48 |
#else // RDebug logging for target HW
|
|
49 |
// ===========================================================================
|
|
50 |
#define FLOG(a) { RDebug::Print(a); }
|
|
51 |
#define FTRACE(a) { a; }
|
|
52 |
#endif //__WINS__
|
|
53 |
|
|
54 |
// ===========================================================================
|
|
55 |
#else // // No loggings --> Reduced binary size
|
|
56 |
// ===========================================================================
|
|
57 |
#define FLOG(a)
|
|
58 |
#define FTRACE(a)
|
|
59 |
|
|
60 |
#endif // _DEBUG
|
|
61 |
|
|
62 |
|
|
63 |
#endif // OBEXUTILS_DEBUG_H
|
|
64 |
|
|
65 |
// End of File
|