14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <QFile> |
18 #include <QFile> |
|
19 #include <QDir> |
19 #include <QTextStream> |
20 #include <QTextStream> |
20 #include <QDateTime> |
21 #include <QDateTime> |
21 #include "irqlogger.h" |
22 #include "irqlogger.h" |
|
23 |
|
24 #if defined(TRACE_TO_FILE) || defined(IRDEBUG_TRACE_TO_FILE) |
|
25 static const char* KTraceOutputDir = "c:/logs/internetradio"; |
|
26 static const char* KTraceOutputFileName = "c:/logs/internetradio/internetradiolog.txt"; |
|
27 static const char* KReadableFileName = "c:/data/internetradiolog.txt"; |
|
28 #endif |
22 |
29 |
23 // ============================================================================ |
30 // ============================================================================ |
24 // SymbianLogger Defenition |
31 // SymbianLogger Defenition |
25 // ============================================================================ |
32 // ============================================================================ |
26 #if defined LOGGING_ENABLED && defined COMBINE_WITH_ENGINE_LOGGER |
33 #if defined LOGGING_ENABLED && defined COMBINE_WITH_ENGINE_LOGGER |
152 QDateTime dateTime( QDateTime::currentDateTime() ); |
159 QDateTime dateTime( QDateTime::currentDateTime() ); |
153 debugStream<<dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz")<<" : "<<message<<endl; |
160 debugStream<<dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz")<<" : "<<message<<endl; |
154 } |
161 } |
155 } |
162 } |
156 } |
163 } |
|
164 |
|
165 |
|
166 // ============================================================================ |
|
167 // Create log dir |
|
168 // ============================================================================ |
|
169 void installLogDir() |
|
170 { |
|
171 #if defined(TRACE_TO_FILE) || defined(IRDEBUG_TRACE_TO_FILE) |
|
172 QDir logDir(KTraceOutputDir); |
|
173 if(!logDir.exists()) |
|
174 { |
|
175 logDir.mkpath(KTraceOutputDir); |
|
176 } |
|
177 |
|
178 QFile logFile(KTraceOutputFileName); |
|
179 if(logFile.exists()) |
|
180 { |
|
181 logFile.remove(KReadableFileName); |
|
182 logFile.copy(KTraceOutputFileName , KReadableFileName); |
|
183 } |
|
184 |
|
185 QFile logFileIRUI("c:/logs/internetradio/iruilog.txt"); |
|
186 if (logFileIRUI.exists()) |
|
187 { |
|
188 logFileIRUI.remove("c:/data/iruilog.txt"); |
|
189 logFileIRUI.copy("c:/logs/internetradio/iruilog.txt" , "c:/data/iruilog.txt"); |
|
190 } |
|
191 #endif |
|
192 } |
|
193 |
|
194 |
157 // ============================================================================ |
195 // ============================================================================ |
158 // SIGNAL/SLOT CONNECTION CHECKER |
196 // SIGNAL/SLOT CONNECTION CHECKER |
159 // ============================================================================ |
197 // ============================================================================ |
160 bool connectAndTest( const QObject* aSender, const char* aSignal, |
198 bool connectAndTest( const QObject* aSender, const char* aSignal, |
161 const QObject* aReceiver, const char* aMember, |
199 const QObject* aReceiver, const char* aMember, |