|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #if !defined(__LOG_H__) |
|
17 #define __LOG_H__ |
|
18 |
|
19 #if 1 |
|
20 #include "guqos_log.h" |
|
21 #else |
|
22 |
|
23 #if !defined(_DEBUG) || EPOC_SDK < 0x06000000 |
|
24 # define LOG(a) |
|
25 #else |
|
26 # define LOG(a) a |
|
27 # define _LOG |
|
28 |
|
29 #include <flogger.h> |
|
30 |
|
31 |
|
32 _LIT(KGUQoSLogFolder,"guqos"); |
|
33 _LIT(KGUQoSLogFile,"guqos.txt"); |
|
34 |
|
35 class Log |
|
36 { |
|
37 public: |
|
38 static inline void Write(const TDesC& aDes); |
|
39 static inline void Printf(TRefByValue<const TDesC> aFmt, ...); |
|
40 static inline void Printf(TRefByValue<const TDesC8> aFmt, ...); |
|
41 static inline void HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen); |
|
42 }; |
|
43 |
|
44 inline void Log::Write(const TDesC& aDes) |
|
45 { |
|
46 RFileLogger::Write(KGUQoSLogFolder(), KGUQoSLogFile(), EFileLoggingModeAppend, aDes); |
|
47 } |
|
48 |
|
49 |
|
50 inline void Log::Printf(TRefByValue<const TDesC> aFmt, ...) |
|
51 { |
|
52 VA_LIST list; |
|
53 VA_START(list,aFmt); |
|
54 RFileLogger::WriteFormat(KGUQoSLogFolder(), KGUQoSLogFile(), EFileLoggingModeAppend, aFmt, list); |
|
55 } |
|
56 |
|
57 inline void Log::Printf(TRefByValue<const TDesC8> aFmt, ...) |
|
58 { |
|
59 VA_LIST list; |
|
60 VA_START(list,aFmt); |
|
61 RFileLogger::WriteFormat(KGUQoSLogFolder(), KGUQoSLogFile(), EFileLoggingModeAppend, aFmt, list); |
|
62 } |
|
63 |
|
64 inline void Log::HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen) |
|
65 { |
|
66 RFileLogger::HexDump(KGUQoSLogFolder(), KGUQoSLogFile(), EFileLoggingModeAppend, aHeader, aMargin, aPtr, aLen); |
|
67 } |
|
68 |
|
69 #endif // !defined(_DEBUG) || EPOC_SDK < 0x06000000 |
|
70 #endif //1 |
|
71 |
|
72 #endif //__LOG_H__ |