|
1 /** |
|
2 * Copyright (c) 2003-2009 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 * FTP protocol DLL |
|
16 * Author: Philippe Gabriel |
|
17 * Some defs for debugging |
|
18 * |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @file DEBUG.H |
|
26 @internalComponent |
|
27 */ |
|
28 |
|
29 #if !defined(__DEBUG_H__) |
|
30 #define __DEBUG_H__ |
|
31 |
|
32 #if defined(_DEBUG) |
|
33 #define __FTPPROTDEBUG__ |
|
34 #endif |
|
35 |
|
36 #if !defined(__FTPPROTDEBUG__) |
|
37 /** |
|
38 @internalComponent |
|
39 */ |
|
40 #define FTPPROTDEBUG(mask,x) |
|
41 #define FTPPROTDEBUG1(mask,x,y) |
|
42 #define FTPPROTDEBUG2(mask,x,y) |
|
43 #define FTPPROTDEBUG3(mask,x,y,z) |
|
44 #else |
|
45 |
|
46 #include <comms-infras/commsdebugutility.h> |
|
47 ////////////////////////////////////////////////////////////// |
|
48 // Definitions |
|
49 ////////////////////////////////////////////////////////////// |
|
50 |
|
51 /** |
|
52 Log files name |
|
53 */ |
|
54 _LIT(KTestLogFileName,"ftpsess.log"); |
|
55 _LIT(KTestLogDir,"ftplog"); |
|
56 |
|
57 /** |
|
58 Main Debug Mask |
|
59 */ |
|
60 #define _DBGflags 0xffff |
|
61 |
|
62 /** |
|
63 Debug flags per module |
|
64 FTPPROT Dll |
|
65 */ |
|
66 #define _DBGFtpprot (1<<0) |
|
67 #define _DBGAnsparse (1<<1) |
|
68 #define _DBGDtpchnl (1<<2) |
|
69 #define _DBGPichnl (1<<3) |
|
70 #define _DBGResolver (1<<4) |
|
71 #define _DBGFtpprotDLL (_DBGAnsparse | _DBGDtpchnl | _DBGPichnl | _DBGResolver | _DBGFtpprot | _DBGFtpseterr) |
|
72 /** FTPSESS Dll */ |
|
73 #define _DBGFtpsess (1<<5) |
|
74 #define _DBGFtpsessDLL (_DBGFtpsess | _DBGFtpseterr) |
|
75 /** various */ |
|
76 #define _DBGFtpseterr (1<<6) |
|
77 |
|
78 /** |
|
79 conditions flags |
|
80 @internalComponent |
|
81 */ |
|
82 #define _DBGEnter (1<<15) |
|
83 #define _DBGExit (1<<16) |
|
84 #define _DBGRecv (1<<17) |
|
85 #define _DBGSnd (1<<18) |
|
86 #define _DBGError (1<<19) |
|
87 |
|
88 /** |
|
89 @internalComponent |
|
90 */ |
|
91 inline void ftpprotdebug(TUint32 aMask, const TPtrC& aDes) |
|
92 { |
|
93 if (_DBGflags & aMask) |
|
94 RFileLogger::Write(KTestLogDir,KTestLogFileName,EFileLoggingModeAppend,aDes); |
|
95 } |
|
96 #define FTPPROTDEBUG(mask,x) ftpprotdebug(mask,x) |
|
97 |
|
98 /** |
|
99 @internalComponent |
|
100 */ |
|
101 inline void ftpprotdebug1(TUint32 aMask, const TPtrC& aDes, TUint aNum) |
|
102 { |
|
103 if (_DBGflags & aMask) |
|
104 RFileLogger::WriteFormat(KTestLogDir,KTestLogFileName,EFileLoggingModeAppend,aDes,aNum); |
|
105 } |
|
106 #define FTPPROTDEBUG1(mask,x,y) ftpprotdebug1(mask,x,y) |
|
107 |
|
108 /** |
|
109 @internalComponent |
|
110 */ |
|
111 inline void ftpprotdebug2(TUint32 aMask, const TPtrC& aDes1, const TPtrC& aDes2) |
|
112 { |
|
113 if (_DBGflags & aMask) |
|
114 RFileLogger::WriteFormat(KTestLogDir,KTestLogFileName,EFileLoggingModeAppend,aDes1,&aDes2); |
|
115 } |
|
116 |
|
117 /** |
|
118 @internalComponent |
|
119 */ |
|
120 #define FTPPROTDEBUG2(mask,x,y) ftpprotdebug2(mask,x,y) |
|
121 |
|
122 /** |
|
123 @internalComponent |
|
124 */ |
|
125 inline void ftpprotdebug3(TUint32 aMask, const TPtrC& aDes, TUint aNum1, TUint aNum2) |
|
126 { |
|
127 if(_DBGflags & aMask) |
|
128 RFileLogger::WriteFormat(KTestLogDir,KTestLogFileName,EFileLoggingModeAppend,aDes,aNum1, aNum2); |
|
129 } |
|
130 #define FTPPROTDEBUG3(mask,x,y,z) ftpprotdebug3(mask,x,y,z) |
|
131 |
|
132 #endif //_DEBUG |
|
133 |
|
134 #endif //__DEBUG_H__ |