|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef NATFWUNSAFLOG_H |
|
22 #define NATFWUNSAFLOG_H |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 #ifdef _DEBUG |
|
27 // Comment the following line to turn off all kind of logging: |
|
28 #define USE_NATFWUNSAF_LOGS |
|
29 #endif |
|
30 |
|
31 |
|
32 #ifdef USE_NATFWUNSAF_LOGS |
|
33 |
|
34 #include <in_sock.h> |
|
35 |
|
36 class NATFWUNSAFLog |
|
37 { |
|
38 public: |
|
39 |
|
40 inline static void Print(const TDesC16& aStr); |
|
41 |
|
42 inline static void Print(const TDesC16& aStr1, |
|
43 const TDesC8& aStr2); |
|
44 |
|
45 inline static void Print(const TDesC16& aStr1, |
|
46 const TDesC16& aStr2); |
|
47 |
|
48 inline static void Print(const TDesC16& aStr, |
|
49 TInt aValue); |
|
50 |
|
51 inline static void Print(const TDesC16& aStr, |
|
52 const TInetAddr& aAddr); |
|
53 |
|
54 inline static void PrintByteStream(const TDesC16& aStr1, |
|
55 const TDesC8& aStr2); |
|
56 }; |
|
57 |
|
58 #include "natfwunsaflog.inl" |
|
59 |
|
60 #define NATFWUNSAF_LOG( a ) NATFWUNSAFLog::Print( _L( a ) ); |
|
61 #define NATFWUNSAF_INTLOG( a, b ) NATFWUNSAFLog::Print( _L( a ), b ); |
|
62 #define NATFWUNSAF_STRLOG( a, b ) NATFWUNSAFLog::Print( _L( a ), b ); |
|
63 #define NATFWUNSAF_STR16LOG( a, b ) NATFWUNSAFLog::Print( _L( a ), b ); |
|
64 #define NATFWUNSAF_ADDRLOG( a, b ) NATFWUNSAFLog::Print( _L( a ), b ); |
|
65 #define NATFWUNSAF_BYTESTREAMLOG( a, b ) NATFWUNSAFLog::PrintByteStream( _L( a ), b ); |
|
66 |
|
67 #else // USE_NATFWUNSAF_LOGS |
|
68 |
|
69 #define NATFWUNSAF_LOG( a ) |
|
70 #define NATFWUNSAF_INTLOG( a, b ) |
|
71 #define NATFWUNSAF_STRLOG( a, b ) |
|
72 #define NATFWUNSAF_STR16LOG( a, b ) |
|
73 #define NATFWUNSAF_ADDRLOG( a, b ) |
|
74 #define NATFWUNSAF_BYTESTREAMLOG( a, b ) |
|
75 |
|
76 #endif // USE_NATFWUNSAF_LOGS |
|
77 |
|
78 |
|
79 #endif // NATFWUNSAFLOG_H |
|
80 |
|
81 |