|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Logging functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILLOG_H |
|
20 #define THUMBNAILLOG_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32svr.h> |
|
24 |
|
25 //log to file instead of RDebug |
|
26 //#define LOG_TO_FILE |
|
27 |
|
28 #ifdef _DEBUG |
|
29 #ifdef LOG_TO_FILE |
|
30 // |
|
31 // Log to file |
|
32 // |
|
33 #include <flogger.h> |
|
34 _LIT( KThumbnailLogDir, "thumbnail" ); |
|
35 _LIT( KThumbnailLogFile, "thumbnail.txt" ); |
|
36 |
|
37 #define TN_DEBUG1( s ) \ |
|
38 RFileLogger::Write( \ |
|
39 KThumbnailLogDir, \ |
|
40 KThumbnailLogFile, \ |
|
41 EFileLoggingModeAppend, \ |
|
42 _L( s ) ); |
|
43 |
|
44 #define TN_DEBUG2( s, a ) \ |
|
45 RFileLogger::WriteFormat( \ |
|
46 KThumbnailLogDir, \ |
|
47 KThumbnailLogFile, \ |
|
48 EFileLoggingModeAppend, \ |
|
49 _L( s ), a ); |
|
50 |
|
51 #define TN_DEBUG3( s, a, b ) \ |
|
52 RFileLogger::WriteFormat( \ |
|
53 KThumbnailLogDir, \ |
|
54 KThumbnailLogFile, \ |
|
55 EFileLoggingModeAppend, \ |
|
56 _L( s ), a, b ); |
|
57 |
|
58 #define TN_DEBUG4( s, a, b, c ) \ |
|
59 RFileLogger::WriteFormat( \ |
|
60 KThumbnailLogDir, \ |
|
61 KThumbnailLogFile, \ |
|
62 EFileLoggingModeAppend, \ |
|
63 _L( s ), a, b, c ); |
|
64 |
|
65 #define TN_DEBUG5( s, a, b, c, d ) \ |
|
66 RFileLogger::WriteFormat( \ |
|
67 KThumbnailLogDir, \ |
|
68 KThumbnailLogFile, \ |
|
69 EFileLoggingModeAppend, \ |
|
70 _L( s ), a, b, c, d ); |
|
71 |
|
72 #define TN_DEBUG6( s, a, b, c, d, e ) \ |
|
73 RFileLogger::WriteFormat( \ |
|
74 KThumbnailLogDir, \ |
|
75 KThumbnailLogFile, \ |
|
76 EFileLoggingModeAppend, \ |
|
77 _L( s ), a, b, c, d, e ); |
|
78 |
|
79 #else // LOG_TO_FILE |
|
80 // |
|
81 // Log to RDebug |
|
82 // |
|
83 #define TN_DEBUG1( s ) RDebug::Print( _L( s ) ) |
|
84 #define TN_DEBUG2( s, a ) RDebug::Print( _L( s ), a ) |
|
85 #define TN_DEBUG3( s, a, b ) RDebug::Print( _L( s ), a, b ) |
|
86 #define TN_DEBUG4( s, a, b, c ) RDebug::Print( _L( s ), a, b, c ) |
|
87 #define TN_DEBUG5( s, a, b, c, d ) RDebug::Print( _L( s ), a, b, c, d ) |
|
88 #define TN_DEBUG6( s, a, b, c, d, e ) RDebug::Print( _L( s ), a, b, c, d, e ) |
|
89 |
|
90 #endif // LOG_TO_FILE |
|
91 |
|
92 #else // _DEBUG |
|
93 // |
|
94 // No logging |
|
95 // |
|
96 #define TN_DEBUG1( s ) |
|
97 #define TN_DEBUG2( s, a ) |
|
98 #define TN_DEBUG3( s, a, b ) |
|
99 #define TN_DEBUG4( s, a, b, c ) |
|
100 #define TN_DEBUG5( s, a, b, c, d ) |
|
101 #define TN_DEBUG6( s, a, b, c, d, e ) |
|
102 |
|
103 #endif // _DEBUG |
|
104 |
|
105 #endif // THUMBNAILLOG_H |