|
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 #ifndef NATTRAVERSALLOG_H |
|
20 #define NATTRAVERSALLOG_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 #ifdef _DEBUG |
|
25 // Comment the following line to turn off all kind of logging: |
|
26 #define USE_NATTRAVERSAL_LOGS |
|
27 #endif |
|
28 |
|
29 |
|
30 #ifdef USE_NATTRAVERSAL_LOGS |
|
31 |
|
32 #include <in_sock.h> |
|
33 |
|
34 class NATTraversalLog |
|
35 { |
|
36 public: |
|
37 |
|
38 inline static void Print(const TDesC16& aStr); |
|
39 |
|
40 inline static void Print(const TDesC16& aStr1, |
|
41 const TDesC8& aStr2); |
|
42 |
|
43 inline static void Print(const TDesC16& aStr, |
|
44 TInt aValue); |
|
45 |
|
46 inline static void Print(const TDesC16& aStr, |
|
47 const TInetAddr& aAddr); |
|
48 }; |
|
49 |
|
50 #include "nattraversallog.inl" |
|
51 |
|
52 #define NATTRAVERSAL_LOG( a ) NATTraversalLog::Print( _L( a ) ); |
|
53 #define NATTRAVERSAL_INTLOG( a, b ) NATTraversalLog::Print( _L( a ), b ); |
|
54 #define NATTRAVERSAL_STRLOG( a, b ) NATTraversalLog::Print( _L( a ), b ); |
|
55 #define NATTRAVERSAL_ADDRLOG( a, b ) NATTraversalLog::Print( _L( a ), b ); |
|
56 |
|
57 #else // USE_NATTRAVERSAL_LOGS |
|
58 |
|
59 #define NATTRAVERSAL_LOG( a ) |
|
60 #define NATTRAVERSAL_INTLOG( a, b ) |
|
61 #define NATTRAVERSAL_STRLOG( a, b ) |
|
62 #define NATTRAVERSAL_ADDRLOG( a, b ) |
|
63 |
|
64 #endif // USE_NATTRAVERSAL_LOGS |
|
65 |
|
66 |
|
67 #endif // NATTRAVERSALLOG_H |
|
68 |
|
69 |