src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Logging.LoggingVisitor.html

branch
eric7
changeset 10479
856476537696
parent 10368
8765229e7cc8
child 11139
cd22e8e705f4
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
5 <link rel="stylesheet" href="styles.css"> 5 <link rel="stylesheet" href="styles.css">
6 </head> 6 </head>
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Logging.LoggingVisitor</h1> 9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Logging.LoggingVisitor</h1>
10
11 <p> 10 <p>
12 Module implementing a node visitor to check for logging issues. 11 Module implementing a node visitor to check for logging issues.
13 </p> 12 </p>
13
14 <h3>Global Attributes</h3> 14 <h3>Global Attributes</h3>
15 15 <table>
16 <table> 16 <tr><td>_LoggerMethods</td></tr>
17 <tr><td>_LoggerMethods</td></tr><tr><td>_LogrecordAttributes</td></tr> 17 <tr><td>_LogrecordAttributes</td></tr>
18 </table> 18 </table>
19
19 <h3>Classes</h3> 20 <h3>Classes</h3>
20 21 <table>
21 <table>
22
23 <tr> 22 <tr>
24 <td><a href="#LoggingVisitor">LoggingVisitor</a></td> 23 <td><a href="#LoggingVisitor">LoggingVisitor</a></td>
25 <td>Class implementing a node visitor to check for logging issues.</td> 24 <td>Class implementing a node visitor to check for logging issues.</td>
26 </tr> 25 </tr>
27 </table> 26 </table>
27
28 <h3>Functions</h3> 28 <h3>Functions</h3>
29 29 <table>
30 <table>
31
32 <tr> 30 <tr>
33 <td><a href="#_modnamedPlaceholderRe">_modnamedPlaceholderRe</a></td> 31 <td><a href="#_modnamedPlaceholderRe">_modnamedPlaceholderRe</a></td>
34 <td>Function to generate a regular expression object for '%' formatting codes using names.</td> 32 <td>Function to generate a regular expression object for '%' formatting codes using names.</td>
35 </tr> 33 </tr>
36 <tr> 34 <tr>
37 <td><a href="#_modposPlaceholderRe">_modposPlaceholderRe</a></td> 35 <td><a href="#_modposPlaceholderRe">_modposPlaceholderRe</a></td>
38 <td>Function to generate a regular expression object for '%' formatting codes.</td> 36 <td>Function to generate a regular expression object for '%' formatting codes.</td>
39 </tr> 37 </tr>
40 </table> 38 </table>
39
41 <hr /> 40 <hr />
42 <hr /> 41 <hr />
43 <a NAME="LoggingVisitor" ID="LoggingVisitor"></a> 42 <a NAME="LoggingVisitor" ID="LoggingVisitor"></a>
44 <h2>LoggingVisitor</h2> 43 <h2>LoggingVisitor</h2>
45
46 <p> 44 <p>
47 Class implementing a node visitor to check for logging issues. 45 Class implementing a node visitor to check for logging issues.
48 </p> 46 </p>
47
49 <h3>Derived from</h3> 48 <h3>Derived from</h3>
50 ast.NodeVisitor 49 ast.NodeVisitor
51 <h3>Class Attributes</h3> 50 <h3>Class Attributes</h3>
52
53 <table> 51 <table>
54 <tr><td>GetLoggerNames</td></tr> 52 <tr><td>GetLoggerNames</td></tr>
55 </table> 53 </table>
54
56 <h3>Class Methods</h3> 55 <h3>Class Methods</h3>
57
58 <table> 56 <table>
59 <tr><td>None</td></tr> 57 <tr><td>None</td></tr>
60 </table> 58 </table>
59
61 <h3>Methods</h3> 60 <h3>Methods</h3>
62 61 <table>
63 <table>
64
65 <tr> 62 <tr>
66 <td><a href="#LoggingVisitor.__init__">LoggingVisitor</a></td> 63 <td><a href="#LoggingVisitor.__init__">LoggingVisitor</a></td>
67 <td>Constructor</td> 64 <td>Constructor</td>
68 </tr> 65 </tr>
69 <tr> 66 <tr>
109 <tr> 106 <tr>
110 <td><a href="#LoggingVisitor.visit_ImportFrom">visit_ImportFrom</a></td> 107 <td><a href="#LoggingVisitor.visit_ImportFrom">visit_ImportFrom</a></td>
111 <td>Public method to handle ImportFrom nodes.</td> 108 <td>Public method to handle ImportFrom nodes.</td>
112 </tr> 109 </tr>
113 </table> 110 </table>
111
114 <h3>Static Methods</h3> 112 <h3>Static Methods</h3>
115
116 <table> 113 <table>
117 <tr><td>None</td></tr> 114 <tr><td>None</td></tr>
118 </table> 115 </table>
116
119 117
120 <a NAME="LoggingVisitor.__init__" ID="LoggingVisitor.__init__"></a> 118 <a NAME="LoggingVisitor.__init__" ID="LoggingVisitor.__init__"></a>
121 <h4>LoggingVisitor (Constructor)</h4> 119 <h4>LoggingVisitor (Constructor)</h4>
122 <b>LoggingVisitor</b>(<i>errorCallback</i>) 120 <b>LoggingVisitor</b>(<i>errorCallback</i>)
123
124 <p> 121 <p>
125 Constructor 122 Constructor
126 </p> 123 </p>
124
127 <dl> 125 <dl>
128 126
129 <dt><i>errorCallback</i> (func)</dt> 127 <dt><i>errorCallback</i> (func)</dt>
130 <dd> 128 <dd>
131 callback function to register an error 129 callback function to register an error
132 </dd> 130 </dd>
133 </dl> 131 </dl>
134 <a NAME="LoggingVisitor.__atModuleLevel" ID="LoggingVisitor.__atModuleLevel"></a> 132 <a NAME="LoggingVisitor.__atModuleLevel" ID="LoggingVisitor.__atModuleLevel"></a>
135 <h4>LoggingVisitor.__atModuleLevel</h4> 133 <h4>LoggingVisitor.__atModuleLevel</h4>
136 <b>__atModuleLevel</b>(<i></i>) 134 <b>__atModuleLevel</b>(<i></i>)
137
138 <p> 135 <p>
139 Private method to check, if we are on the module level. 136 Private method to check, if we are on the module level.
140 </p> 137 </p>
138
141 <dl> 139 <dl>
142 <dt>Return:</dt> 140 <dt>Return:</dt>
143 <dd> 141 <dd>
144 flag indicating the module level 142 flag indicating the module level
145 </dd> 143 </dd>
151 </dd> 149 </dd>
152 </dl> 150 </dl>
153 <a NAME="LoggingVisitor.__checkMsgAndArgs" ID="LoggingVisitor.__checkMsgAndArgs"></a> 151 <a NAME="LoggingVisitor.__checkMsgAndArgs" ID="LoggingVisitor.__checkMsgAndArgs"></a>
154 <h4>LoggingVisitor.__checkMsgAndArgs</h4> 152 <h4>LoggingVisitor.__checkMsgAndArgs</h4>
155 <b>__checkMsgAndArgs</b>(<i>node, msgArg, msg</i>) 153 <b>__checkMsgAndArgs</b>(<i>node, msgArg, msg</i>)
156
157 <p> 154 <p>
158 Private method to check the message and arguments a given Call node. 155 Private method to check the message and arguments a given Call node.
159 </p> 156 </p>
157
160 <dl> 158 <dl>
161 159
162 <dt><i>node</i> (ast.Call)</dt> 160 <dt><i>node</i> (ast.Call)</dt>
163 <dd> 161 <dd>
164 reference to the Call node 162 reference to the Call node
173 </dd> 171 </dd>
174 </dl> 172 </dl>
175 <a NAME="LoggingVisitor.__currentExceptHandler" ID="LoggingVisitor.__currentExceptHandler"></a> 173 <a NAME="LoggingVisitor.__currentExceptHandler" ID="LoggingVisitor.__currentExceptHandler"></a>
176 <h4>LoggingVisitor.__currentExceptHandler</h4> 174 <h4>LoggingVisitor.__currentExceptHandler</h4>
177 <b>__currentExceptHandler</b>(<i></i>) 175 <b>__currentExceptHandler</b>(<i></i>)
178
179 <p> 176 <p>
180 Private method to determine the current exception handler node. 177 Private method to determine the current exception handler node.
181 </p> 178 </p>
179
182 <dl> 180 <dl>
183 <dt>Return:</dt> 181 <dt>Return:</dt>
184 <dd> 182 <dd>
185 reference to the current exception handler node or None 183 reference to the current exception handler node or None
186 </dd> 184 </dd>
192 </dd> 190 </dd>
193 </dl> 191 </dl>
194 <a NAME="LoggingVisitor.__flattenStrChain" ID="LoggingVisitor.__flattenStrChain"></a> 192 <a NAME="LoggingVisitor.__flattenStrChain" ID="LoggingVisitor.__flattenStrChain"></a>
195 <h4>LoggingVisitor.__flattenStrChain</h4> 193 <h4>LoggingVisitor.__flattenStrChain</h4>
196 <b>__flattenStrChain</b>(<i>node</i>) 194 <b>__flattenStrChain</b>(<i>node</i>)
197
198 <p> 195 <p>
199 Private method to flatten the given string chain. 196 Private method to flatten the given string chain.
200 </p> 197 </p>
198
201 <dl> 199 <dl>
202 200
203 <dt><i>node</i> (ast.AST)</dt> 201 <dt><i>node</i> (ast.AST)</dt>
204 <dd> 202 <dd>
205 reference to the AST node 203 reference to the AST node
218 </dd> 216 </dd>
219 </dl> 217 </dl>
220 <a NAME="LoggingVisitor.__isAddChainWithNonStr" ID="LoggingVisitor.__isAddChainWithNonStr"></a> 218 <a NAME="LoggingVisitor.__isAddChainWithNonStr" ID="LoggingVisitor.__isAddChainWithNonStr"></a>
221 <h4>LoggingVisitor.__isAddChainWithNonStr</h4> 219 <h4>LoggingVisitor.__isAddChainWithNonStr</h4>
222 <b>__isAddChainWithNonStr</b>(<i>node</i>) 220 <b>__isAddChainWithNonStr</b>(<i>node</i>)
223
224 <p> 221 <p>
225 Private method to check, if the node is an Add with a non string argument. 222 Private method to check, if the node is an Add with a non string argument.
226 </p> 223 </p>
224
227 <dl> 225 <dl>
228 226
229 <dt><i>node</i> (ast.BinOp)</dt> 227 <dt><i>node</i> (ast.BinOp)</dt>
230 <dd> 228 <dd>
231 reference to the binary operator node 229 reference to the binary operator node
244 </dd> 242 </dd>
245 </dl> 243 </dl>
246 <a NAME="LoggingVisitor.__keywordPos" ID="LoggingVisitor.__keywordPos"></a> 244 <a NAME="LoggingVisitor.__keywordPos" ID="LoggingVisitor.__keywordPos"></a>
247 <h4>LoggingVisitor.__keywordPos</h4> 245 <h4>LoggingVisitor.__keywordPos</h4>
248 <b>__keywordPos</b>(<i>node</i>) 246 <b>__keywordPos</b>(<i>node</i>)
249
250 <p> 247 <p>
251 Private method determine line number and column offset of a given keyword node. 248 Private method determine line number and column offset of a given keyword node.
252 </p> 249 </p>
250
253 <dl> 251 <dl>
254 252
255 <dt><i>node</i> (ast.keyword)</dt> 253 <dt><i>node</i> (ast.keyword)</dt>
256 <dd> 254 <dd>
257 reference to the keyword node 255 reference to the keyword node
274 <b>visit</b>(<i></i>) 272 <b>visit</b>(<i></i>)
275 273
276 <a NAME="LoggingVisitor.visit_Attribute" ID="LoggingVisitor.visit_Attribute"></a> 274 <a NAME="LoggingVisitor.visit_Attribute" ID="LoggingVisitor.visit_Attribute"></a>
277 <h4>LoggingVisitor.visit_Attribute</h4> 275 <h4>LoggingVisitor.visit_Attribute</h4>
278 <b>visit_Attribute</b>(<i>node</i>) 276 <b>visit_Attribute</b>(<i>node</i>)
279
280 <p> 277 <p>
281 Public method to handle Attribute nodes. 278 Public method to handle Attribute nodes.
282 </p> 279 </p>
280
283 <dl> 281 <dl>
284 282
285 <dt><i>node</i> (ast.Attribute)</dt> 283 <dt><i>node</i> (ast.Attribute)</dt>
286 <dd> 284 <dd>
287 reference to the node to be processed 285 reference to the node to be processed
288 </dd> 286 </dd>
289 </dl> 287 </dl>
290 <a NAME="LoggingVisitor.visit_Call" ID="LoggingVisitor.visit_Call"></a> 288 <a NAME="LoggingVisitor.visit_Call" ID="LoggingVisitor.visit_Call"></a>
291 <h4>LoggingVisitor.visit_Call</h4> 289 <h4>LoggingVisitor.visit_Call</h4>
292 <b>visit_Call</b>(<i>node</i>) 290 <b>visit_Call</b>(<i>node</i>)
293
294 <p> 291 <p>
295 Public method to handle Call nodes. 292 Public method to handle Call nodes.
296 </p> 293 </p>
294
297 <dl> 295 <dl>
298 296
299 <dt><i>node</i> (ast.Call)</dt> 297 <dt><i>node</i> (ast.Call)</dt>
300 <dd> 298 <dd>
301 reference to the node to be processed 299 reference to the node to be processed
302 </dd> 300 </dd>
303 </dl> 301 </dl>
304 <a NAME="LoggingVisitor.visit_Import" ID="LoggingVisitor.visit_Import"></a> 302 <a NAME="LoggingVisitor.visit_Import" ID="LoggingVisitor.visit_Import"></a>
305 <h4>LoggingVisitor.visit_Import</h4> 303 <h4>LoggingVisitor.visit_Import</h4>
306 <b>visit_Import</b>(<i>node</i>) 304 <b>visit_Import</b>(<i>node</i>)
307
308 <p> 305 <p>
309 Public method to handle Import nodes. 306 Public method to handle Import nodes.
310 </p> 307 </p>
308
311 <dl> 309 <dl>
312 310
313 <dt><i>node</i> (ast.Import)</dt> 311 <dt><i>node</i> (ast.Import)</dt>
314 <dd> 312 <dd>
315 reference to the node to be processed 313 reference to the node to be processed
316 </dd> 314 </dd>
317 </dl> 315 </dl>
318 <a NAME="LoggingVisitor.visit_ImportFrom" ID="LoggingVisitor.visit_ImportFrom"></a> 316 <a NAME="LoggingVisitor.visit_ImportFrom" ID="LoggingVisitor.visit_ImportFrom"></a>
319 <h4>LoggingVisitor.visit_ImportFrom</h4> 317 <h4>LoggingVisitor.visit_ImportFrom</h4>
320 <b>visit_ImportFrom</b>(<i>node</i>) 318 <b>visit_ImportFrom</b>(<i>node</i>)
321
322 <p> 319 <p>
323 Public method to handle ImportFrom nodes. 320 Public method to handle ImportFrom nodes.
324 </p> 321 </p>
322
325 <dl> 323 <dl>
326 324
327 <dt><i>node</i> (ast.ImportFrom)</dt> 325 <dt><i>node</i> (ast.ImportFrom)</dt>
328 <dd> 326 <dd>
329 reference to the node to be processed 327 reference to the node to be processed
333 <hr /> 331 <hr />
334 <hr /> 332 <hr />
335 <a NAME="_modnamedPlaceholderRe" ID="_modnamedPlaceholderRe"></a> 333 <a NAME="_modnamedPlaceholderRe" ID="_modnamedPlaceholderRe"></a>
336 <h2>_modnamedPlaceholderRe</h2> 334 <h2>_modnamedPlaceholderRe</h2>
337 <b>_modnamedPlaceholderRe</b>(<i></i>) 335 <b>_modnamedPlaceholderRe</b>(<i></i>)
338
339 <p> 336 <p>
340 Function to generate a regular expression object for '%' formatting codes using 337 Function to generate a regular expression object for '%' formatting codes using
341 names. 338 names.
342 </p> 339 </p>
340
343 <dl> 341 <dl>
344 <dt>Return:</dt> 342 <dt>Return:</dt>
345 <dd> 343 <dd>
346 regular expression object 344 regular expression object
347 </dd> 345 </dd>
356 <hr /> 354 <hr />
357 <hr /> 355 <hr />
358 <a NAME="_modposPlaceholderRe" ID="_modposPlaceholderRe"></a> 356 <a NAME="_modposPlaceholderRe" ID="_modposPlaceholderRe"></a>
359 <h2>_modposPlaceholderRe</h2> 357 <h2>_modposPlaceholderRe</h2>
360 <b>_modposPlaceholderRe</b>(<i></i>) 358 <b>_modposPlaceholderRe</b>(<i></i>)
361
362 <p> 359 <p>
363 Function to generate a regular expression object for '%' formatting codes. 360 Function to generate a regular expression object for '%' formatting codes.
364 </p> 361 </p>
362
365 <dl> 363 <dl>
366 <dt>Return:</dt> 364 <dt>Return:</dt>
367 <dd> 365 <dd>
368 regular expression object 366 regular expression object
369 </dd> 367 </dd>

eric ide

mercurial