1 /* |
|
2 * Copyright (c) 2006 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LCLOGGER_H |
|
20 #define LCLOGGER_H |
|
21 |
|
22 #include <QDebug> |
|
23 |
|
24 |
|
25 // Disabled PC_lint warning for "Undefined preprocessor variable 'UNIT_TESTING'" |
|
26 //lint -e553 |
|
27 #if ( !defined(_DEBUG) || defined(QT_NO_DEBUG_OUTPUT) ) // release or unit test build; no logs |
|
28 |
|
29 #define LC_QDEBUG( a ) |
|
30 #define LC_QDEBUG_2( a, b) |
|
31 #define LC_QDEBUG_3( a, b, c) |
|
32 #define LC_QDEBUG_4( a, b, c, d) |
|
33 #define LC_QWARNING( a ) |
|
34 #define LC_QWARNING_2( a, b ) |
|
35 #define LC_QCRITICAL( a ) |
|
36 #define LC_QCRITICAL_2( a, b ) |
|
37 #define LC_QCRITICAL_3( a, b, c) |
|
38 |
|
39 #else // debug build; logs |
|
40 |
|
41 |
|
42 const char lcDebugPrefix[] = "Debug: "; |
|
43 const char lcWarningPrefix[] = "Warning: "; |
|
44 const char lcCriticalPrefix[] = "Critical: "; |
|
45 const char lcFatalPrefix[] = "Fatal: "; |
|
46 |
|
47 #include <e32debug.h> // RDebug |
|
48 #include <QFile> |
|
49 #include <QTextStream> |
|
50 #include <qapplication.h> |
|
51 #include <stdio.h> |
|
52 #include <stdlib.h> |
|
53 |
|
54 const char lcLogFile[] = "C:/logs/mus/musdebug.txt";// MultimediaSharing logging file. |
|
55 |
|
56 |
|
57 #define LC_QDEBUG( a )\ |
|
58 qDebug() << a; |
|
59 |
|
60 #define LC_QDEBUG_2( a, b)\ |
|
61 qDebug() << a << b; |
|
62 |
|
63 #define LC_QDEBUG_3( a, b, c)\ |
|
64 qDebug() << a << b << c; |
|
65 |
|
66 #define LC_QDEBUG_4( a, b, c, d)\ |
|
67 qDebug() << a << b << c << d; |
|
68 |
|
69 #define LC_QWARNING( a )\ |
|
70 qWarning() << a; |
|
71 |
|
72 #define LC_QWARNING_2( a, b )\ |
|
73 qWarning() << a << b; |
|
74 |
|
75 #define LC_QCRITICAL( a )\ |
|
76 qCritical() << a; |
|
77 |
|
78 #define LC_QCRITICAL_2( a, b )\ |
|
79 qCritical() << a << b; |
|
80 |
|
81 #define LC_QCRITICAL_3( a, b, c)\ |
|
82 qCritical() << a << b << c; |
|
83 |
|
84 |
|
85 // File logging can be disabled by commenting above definition. |
|
86 #define LCUI_FILE_LOGGING_ENABLED |
|
87 |
|
88 #if ( defined __WINSCW__ ) || ( defined __WINS__ ) |
|
89 // No sense to have file logging enabled in wins |
|
90 #undef LCUI_FILE_LOGGING_ENABLED |
|
91 #endif |
|
92 |
|
93 #ifdef LCUI_FILE_LOGGING_ENABLED |
|
94 const bool lcFileLoggingEnabled = ETrue; |
|
95 #else |
|
96 const bool lcFileLoggingEnabled = EFalse; |
|
97 #endif |
|
98 |
|
99 |
|
100 #endif |
|
101 |
|
102 #endif // LCLOGGER_H |
|
103 |
|
104 // End of File |
|