24
|
1 |
// Copyright (c) 2005-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 |
// @file qosextn_log.h
|
|
15 |
// Header file for qos extn API log
|
|
16 |
//
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
@internalComponent
|
|
22 |
*/
|
|
23 |
#if !defined(__LOG_H__)
|
|
24 |
#define __LOG_H__
|
|
25 |
|
|
26 |
#if !defined(_DEBUG)
|
|
27 |
# define LOG(a)
|
|
28 |
#else
|
|
29 |
# define LOG(a) a
|
|
30 |
# define _LOG
|
|
31 |
|
|
32 |
#include <flogger.h>
|
|
33 |
|
|
34 |
_LIT(KQoSExtnLogFolder,"qosextnapi");
|
|
35 |
_LIT(KQoSExtnLogFile,"qosextnapi.txt");
|
|
36 |
|
|
37 |
class Log
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
static inline void Write(const TDesC& aDes);
|
|
41 |
static inline void Printf(TRefByValue<const TDesC> aFmt, ...);
|
|
42 |
static inline void Printf(TRefByValue<const TDesC8> aFmt, ...);
|
|
43 |
static inline void HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen);
|
|
44 |
};
|
|
45 |
|
|
46 |
inline void Log::Write(const TDesC& aDes)
|
|
47 |
{
|
|
48 |
RFileLogger::Write(KQoSExtnLogFolder(), KQoSExtnLogFile(), EFileLoggingModeAppend, aDes);
|
|
49 |
}
|
|
50 |
|
|
51 |
|
|
52 |
inline void Log::Printf(TRefByValue<const TDesC> aFmt, ...)
|
|
53 |
{
|
|
54 |
VA_LIST list;
|
|
55 |
VA_START(list,aFmt);
|
|
56 |
RFileLogger::WriteFormat(KQoSExtnLogFolder(), KQoSExtnLogFile(), EFileLoggingModeAppend, aFmt, list);
|
|
57 |
}
|
|
58 |
|
|
59 |
inline void Log::Printf(TRefByValue<const TDesC8> aFmt, ...)
|
|
60 |
{
|
|
61 |
VA_LIST list;
|
|
62 |
VA_START(list,aFmt);
|
|
63 |
RFileLogger::WriteFormat(KQoSExtnLogFolder(), KQoSExtnLogFile(), EFileLoggingModeAppend, aFmt, list);
|
|
64 |
}
|
|
65 |
|
|
66 |
inline void Log::HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen)
|
|
67 |
{
|
|
68 |
RFileLogger::HexDump(KQoSExtnLogFolder(), KQoSExtnLogFile(), EFileLoggingModeAppend, aHeader, aMargin, aPtr, aLen);
|
|
69 |
}
|
|
70 |
|
|
71 |
#endif // !defined(_DEBUG)
|
|
72 |
|
|
73 |
#endif //__LOG_H__
|
|
74 |
|