blob: 5a96664c29d8d27f7ba91d01d3ad84a7600300dc [file] [log] [blame]
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001#!/usr/bin/env python
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002"""
Brett Cannonf9db8a32008-02-17 01:59:18 +00003Test 0
4======
Neal Norwitzb4a2df02003-01-02 14:56:39 +00005
Brett Cannonf9db8a32008-02-17 01:59:18 +00006Some preliminaries:
7>>> import sys
8>>> import logging
9>>> def nextmessage():
10... global msgcount
11... rv = "Message %d" % msgcount
12... msgcount = msgcount + 1
13... return rv
14
15Set a few variables, then go through the logger autoconfig and set the default threshold.
16>>> msgcount = 0
17>>> FINISH_UP = "Finish up, it's closing time. Messages should bear numbers 0 through 24."
18>>> logging.basicConfig(stream=sys.stdout)
19>>> rootLogger = logging.getLogger("")
20>>> rootLogger.setLevel(logging.DEBUG)
21
22Now, create a bunch of loggers, and set their thresholds.
23>>> ERR = logging.getLogger("ERR0")
24>>> ERR.setLevel(logging.ERROR)
25>>> INF = logging.getLogger("INFO0")
26>>> INF.setLevel(logging.INFO)
27>>> INF_ERR = logging.getLogger("INFO0.ERR")
28>>> INF_ERR.setLevel(logging.ERROR)
29>>> DEB = logging.getLogger("DEB0")
30>>> DEB.setLevel(logging.DEBUG)
31>>> INF_UNDEF = logging.getLogger("INFO0.UNDEF")
32>>> INF_ERR_UNDEF = logging.getLogger("INFO0.ERR.UNDEF")
33>>> UNDEF = logging.getLogger("UNDEF0")
34>>> GRANDCHILD = logging.getLogger("INFO0.BADPARENT.UNDEF")
35>>> CHILD = logging.getLogger("INFO0.BADPARENT")
36
37
38And finally, run all the tests.
39
40>>> ERR.log(logging.FATAL, nextmessage())
41CRITICAL:ERR0:Message 0
42
43>>> ERR.error(nextmessage())
44ERROR:ERR0:Message 1
45
46>>> INF.log(logging.FATAL, nextmessage())
47CRITICAL:INFO0:Message 2
48
49>>> INF.error(nextmessage())
50ERROR:INFO0:Message 3
51
52>>> INF.warn(nextmessage())
53WARNING:INFO0:Message 4
54
55>>> INF.info(nextmessage())
56INFO:INFO0:Message 5
57
58>>> INF_UNDEF.log(logging.FATAL, nextmessage())
59CRITICAL:INFO0.UNDEF:Message 6
60
61>>> INF_UNDEF.error(nextmessage())
62ERROR:INFO0.UNDEF:Message 7
63
64>>> INF_UNDEF.warn (nextmessage())
65WARNING:INFO0.UNDEF:Message 8
66
67>>> INF_UNDEF.info (nextmessage())
68INFO:INFO0.UNDEF:Message 9
69
70>>> INF_ERR.log(logging.FATAL, nextmessage())
71CRITICAL:INFO0.ERR:Message 10
72
73>>> INF_ERR.error(nextmessage())
74ERROR:INFO0.ERR:Message 11
75
76>>> INF_ERR_UNDEF.log(logging.FATAL, nextmessage())
77CRITICAL:INFO0.ERR.UNDEF:Message 12
78
79>>> INF_ERR_UNDEF.error(nextmessage())
80ERROR:INFO0.ERR.UNDEF:Message 13
81
82>>> DEB.log(logging.FATAL, nextmessage())
83CRITICAL:DEB0:Message 14
84
85>>> DEB.error(nextmessage())
86ERROR:DEB0:Message 15
87
88>>> DEB.warn (nextmessage())
89WARNING:DEB0:Message 16
90
91>>> DEB.info (nextmessage())
92INFO:DEB0:Message 17
93
94>>> DEB.debug(nextmessage())
95DEBUG:DEB0:Message 18
96
97>>> UNDEF.log(logging.FATAL, nextmessage())
98CRITICAL:UNDEF0:Message 19
99
100>>> UNDEF.error(nextmessage())
101ERROR:UNDEF0:Message 20
102
103>>> UNDEF.warn (nextmessage())
104WARNING:UNDEF0:Message 21
105
106>>> UNDEF.info (nextmessage())
107INFO:UNDEF0:Message 22
108
109>>> GRANDCHILD.log(logging.FATAL, nextmessage())
110CRITICAL:INFO0.BADPARENT.UNDEF:Message 23
111
112>>> CHILD.log(logging.FATAL, nextmessage())
113CRITICAL:INFO0.BADPARENT:Message 24
114
115These should not log:
116
117>>> ERR.warn(nextmessage())
118
119>>> ERR.info(nextmessage())
120
121>>> ERR.debug(nextmessage())
122
123>>> INF.debug(nextmessage())
124
125>>> INF_UNDEF.debug(nextmessage())
126
127>>> INF_ERR.warn(nextmessage())
128
129>>> INF_ERR.info(nextmessage())
130
131>>> INF_ERR.debug(nextmessage())
132
133>>> INF_ERR_UNDEF.warn(nextmessage())
134
135>>> INF_ERR_UNDEF.info(nextmessage())
136
137>>> INF_ERR_UNDEF.debug(nextmessage())
138
139>>> INF.info(FINISH_UP)
140INFO:INFO0:Finish up, it's closing time. Messages should bear numbers 0 through 24.
141
142Test 1
143======
144
145>>> import sys, logging
146>>> logging.basicConfig(stream=sys.stdout)
147
148First, we define our levels. There can be as many as you want - the only
149limitations are that they should be integers, the lowest should be > 0 and
150larger values mean less information being logged. If you need specific
151level values which do not fit into these limitations, you can use a
152mapping dictionary to convert between your application levels and the
153logging system.
154
155>>> SILENT = 10
156>>> TACITURN = 9
157>>> TERSE = 8
158>>> EFFUSIVE = 7
159>>> SOCIABLE = 6
160>>> VERBOSE = 5
161>>> TALKATIVE = 4
162>>> GARRULOUS = 3
163>>> CHATTERBOX = 2
164>>> BORING = 1
165>>> LEVEL_RANGE = range(BORING, SILENT + 1)
166
167
168Next, we define names for our levels. You don't need to do this - in which
169 case the system will use "Level n" to denote the text for the level.
170'
171
172
173>>> my_logging_levels = {
174... SILENT : 'SILENT',
175... TACITURN : 'TACITURN',
176... TERSE : 'TERSE',
177... EFFUSIVE : 'EFFUSIVE',
178... SOCIABLE : 'SOCIABLE',
179... VERBOSE : 'VERBOSE',
180... TALKATIVE : 'TALKATIVE',
181... GARRULOUS : 'GARRULOUS',
182... CHATTERBOX : 'CHATTERBOX',
183... BORING : 'BORING',
184... }
185
186
187Now, to demonstrate filtering: suppose for some perverse reason we only
188want to print out all except GARRULOUS messages. We create a filter for
189this purpose...
190
191>>> class SpecificLevelFilter(logging.Filter):
192... def __init__(self, lvl):
193... self.level = lvl
194...
195... def filter(self, record):
196... return self.level != record.levelno
197
198>>> class GarrulousFilter(SpecificLevelFilter):
199... def __init__(self):
200... SpecificLevelFilter.__init__(self, GARRULOUS)
201
202
203Now, demonstrate filtering at the logger. This time, use a filter
204which excludes SOCIABLE and TACITURN messages. Note that GARRULOUS events
205are still excluded.
206
207
208>>> class VerySpecificFilter(logging.Filter):
209... def filter(self, record):
210... return record.levelno not in [SOCIABLE, TACITURN]
211
212>>> SHOULD1 = "This should only be seen at the '%s' logging level (or lower)"
213
214Configure the logger, and tell the logging system to associate names with our levels.
215>>> logging.basicConfig(stream=sys.stdout)
216>>> rootLogger = logging.getLogger("")
217>>> rootLogger.setLevel(logging.DEBUG)
218>>> for lvl in my_logging_levels.keys():
219... logging.addLevelName(lvl, my_logging_levels[lvl])
220>>> log = logging.getLogger("")
221>>> hdlr = log.handlers[0]
222>>> from test_logging import message
223
224Set the logging level to each different value and call the utility
225function to log events. In the output, you should see that each time
226round the loop, the number of logging events which are actually output
227decreases.
228
229>>> log.setLevel(1)
230
231>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
232BORING:root:This should only be seen at the '1' logging level (or lower)
233
234>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
235CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
236
237>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
238GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
239
240>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
241TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
242
243>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
244VERBOSE:root:This should only be seen at the '5' logging level (or lower)
245
246>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
247SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
248
249>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
250EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
251
252>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
253TERSE:root:This should only be seen at the '8' logging level (or lower)
254
255>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
256TACITURN:root:This should only be seen at the '9' logging level (or lower)
257
258>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
259SILENT:root:This should only be seen at the '10' logging level (or lower)
260
261>>> log.setLevel(0)
262
263>>> log.setLevel(2)
264
265>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
266
267>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
268CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
269
270>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
271GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
272
273>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
274TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
275
276>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
277VERBOSE:root:This should only be seen at the '5' logging level (or lower)
278
279>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
280SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
281
282>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
283EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
284
285>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
286TERSE:root:This should only be seen at the '8' logging level (or lower)
287
288>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
289TACITURN:root:This should only be seen at the '9' logging level (or lower)
290
291>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
292SILENT:root:This should only be seen at the '10' logging level (or lower)
293
294>>> log.setLevel(3)
295
296>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
297
298>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
299
300>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
301GARRULOUS:root:This should only be seen at the '3' logging level (or lower)
302
303>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
304TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
305
306>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
307VERBOSE:root:This should only be seen at the '5' logging level (or lower)
308
309>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
310SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
311
312>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
313EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
314
315>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
316TERSE:root:This should only be seen at the '8' logging level (or lower)
317
318>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
319TACITURN:root:This should only be seen at the '9' logging level (or lower)
320
321>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
322SILENT:root:This should only be seen at the '10' logging level (or lower)
323
324>>> log.setLevel(4)
325
326>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
327
328>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
329
330>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
331
332>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
333TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
334
335>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
336VERBOSE:root:This should only be seen at the '5' logging level (or lower)
337
338>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
339SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
340
341>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
342EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
343
344>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
345TERSE:root:This should only be seen at the '8' logging level (or lower)
346
347>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
348TACITURN:root:This should only be seen at the '9' logging level (or lower)
349
350>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
351SILENT:root:This should only be seen at the '10' logging level (or lower)
352
353>>> log.setLevel(5)
354
355>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
356
357>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
358
359>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
360
361>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
362
363>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
364VERBOSE:root:This should only be seen at the '5' logging level (or lower)
365
366>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
367SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
368
369>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
370EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
371
372>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
373TERSE:root:This should only be seen at the '8' logging level (or lower)
374
375>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
376TACITURN:root:This should only be seen at the '9' logging level (or lower)
377
378>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
379SILENT:root:This should only be seen at the '10' logging level (or lower)
380
381
382>>> log.setLevel(6)
383
384>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
385
386>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
387
388>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
389
390>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
391
392>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
393
394>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
395SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
396
397>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
398EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
399
400>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
401TERSE:root:This should only be seen at the '8' logging level (or lower)
402
403>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
404TACITURN:root:This should only be seen at the '9' logging level (or lower)
405
406>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
407SILENT:root:This should only be seen at the '10' logging level (or lower)
408
409>>> log.setLevel(7)
410
411>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
412
413>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
414
415>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
416
417>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
418
419>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
420
421>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
422
423>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
424EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
425
426>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
427TERSE:root:This should only be seen at the '8' logging level (or lower)
428
429>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
430TACITURN:root:This should only be seen at the '9' logging level (or lower)
431
432>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
433SILENT:root:This should only be seen at the '10' logging level (or lower)
434
435>>> log.setLevel(8)
436
437>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
438
439>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
440
441>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
442
443>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
444
445>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
446
447>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
448
449>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
450
451>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
452TERSE:root:This should only be seen at the '8' logging level (or lower)
453
454>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
455TACITURN:root:This should only be seen at the '9' logging level (or lower)
456
457>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
458SILENT:root:This should only be seen at the '10' logging level (or lower)
459
460>>> log.setLevel(0)
461
462>>> log.setLevel(9)
463
464>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
465
466>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
467
468>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
469
470>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
471
472>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
473
474>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
475
476>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
477
478>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
479
480>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
481TACITURN:root:This should only be seen at the '9' logging level (or lower)
482
483>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
484SILENT:root:This should only be seen at the '10' logging level (or lower)
485
486>>> log.setLevel(0)
487
488>>> log.setLevel(10)
489
490>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
491
492>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
493
494>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
495
496>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
497
498>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
499
500>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
501
502>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
503
504>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
505
506>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
507
508>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
509SILENT:root:This should only be seen at the '10' logging level (or lower)
510
511>>> hdlr.setLevel(SOCIABLE)
512
513>>> log.setLevel(1)
514
515>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
516
517>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
518
519>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
520
521>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
522
523>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
524
525>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
526SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
527
528>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
529EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
530
531>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
532TERSE:root:This should only be seen at the '8' logging level (or lower)
533
534>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
535TACITURN:root:This should only be seen at the '9' logging level (or lower)
536
537>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
538SILENT:root:This should only be seen at the '10' logging level (or lower)
539
540>>> log.setLevel(2)
541
542>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
543
544>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
545
546>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
547
548>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
549
550>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
551
552>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
553SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
554
555>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
556EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
557
558>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
559TERSE:root:This should only be seen at the '8' logging level (or lower)
560
561>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
562TACITURN:root:This should only be seen at the '9' logging level (or lower)
563
564>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
565SILENT:root:This should only be seen at the '10' logging level (or lower)
566
567>>> log.setLevel(3)
568
569>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
570
571>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
572
573>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
574
575>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
576
577>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
578
579>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
580SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
581
582>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
583EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
584
585>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
586TERSE:root:This should only be seen at the '8' logging level (or lower)
587
588>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
589TACITURN:root:This should only be seen at the '9' logging level (or lower)
590
591>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
592SILENT:root:This should only be seen at the '10' logging level (or lower)
593
594>>> log.setLevel(0)
595
596>>> log.setLevel(4)
597
598>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
599
600>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
601
602>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
603
604>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
605
606>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
607
608>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
609SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
610
611>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
612EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
613
614>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
615TERSE:root:This should only be seen at the '8' logging level (or lower)
616
617>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
618TACITURN:root:This should only be seen at the '9' logging level (or lower)
619
620>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
621SILENT:root:This should only be seen at the '10' logging level (or lower)
622
623>>> log.setLevel(0)
624
625>>> log.setLevel(5)
626
627>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
628
629>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
630
631>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
632
633>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
634
635>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
636
637>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
638SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
639
640>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
641EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
642
643>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
644TERSE:root:This should only be seen at the '8' logging level (or lower)
645
646>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
647TACITURN:root:This should only be seen at the '9' logging level (or lower)
648
649>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
650SILENT:root:This should only be seen at the '10' logging level (or lower)
651
652>>> log.setLevel(0)
653
654>>> log.setLevel(6)
655
656>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
657
658>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
659
660>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
661
662>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
663
664>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
665
666>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
667SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
668
669>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
670EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
671
672>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
673TERSE:root:This should only be seen at the '8' logging level (or lower)
674
675>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
676TACITURN:root:This should only be seen at the '9' logging level (or lower)
677
678>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
679SILENT:root:This should only be seen at the '10' logging level (or lower)
680
681>>> log.setLevel(0)
682
683>>> log.setLevel(7)
684
685>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
686
687>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
688
689>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
690
691>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
692
693>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
694
695>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
696
697>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
698EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
699
700>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
701TERSE:root:This should only be seen at the '8' logging level (or lower)
702
703>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
704TACITURN:root:This should only be seen at the '9' logging level (or lower)
705
706>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
707SILENT:root:This should only be seen at the '10' logging level (or lower)
708
709>>> log.setLevel(0)
710
711>>> log.setLevel(8)
712
713>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
714
715>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
716
717>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
718
719>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
720
721>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
722
723>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
724
725>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
726
727>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
728TERSE:root:This should only be seen at the '8' logging level (or lower)
729
730>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
731TACITURN:root:This should only be seen at the '9' logging level (or lower)
732
733>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
734SILENT:root:This should only be seen at the '10' logging level (or lower)
735
736>>> log.setLevel(0)
737
738>>> log.setLevel(9)
739
740>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
741
742>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
743
744>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
745
746>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
747
748>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
749
750>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
751
752>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
753
754>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
755
756>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
757TACITURN:root:This should only be seen at the '9' logging level (or lower)
758
759>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
760SILENT:root:This should only be seen at the '10' logging level (or lower)
761
762>>> log.setLevel(0)
763
764>>> log.setLevel(10)
765
766>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
767
768>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
769
770>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
771
772>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
773
774>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
775
776>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
777
778>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
779
780>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
781
782>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
783
784>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
785SILENT:root:This should only be seen at the '10' logging level (or lower)
786
787>>> log.setLevel(0)
788
789>>>
790
791>>> hdlr.setLevel(0)
792
793>>> garr = GarrulousFilter()
794
795>>> hdlr.addFilter(garr)
796
797>>> log.setLevel(1)
798
799>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
800BORING:root:This should only be seen at the '1' logging level (or lower)
801
802>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
803CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
804
805>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
806
807>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
808TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
809
810>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
811VERBOSE:root:This should only be seen at the '5' logging level (or lower)
812
813>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
814SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
815
816>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
817EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
818
819>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
820TERSE:root:This should only be seen at the '8' logging level (or lower)
821
822>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
823TACITURN:root:This should only be seen at the '9' logging level (or lower)
824
825>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
826SILENT:root:This should only be seen at the '10' logging level (or lower)
827
828>>> log.setLevel(2)
829
830>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
831
832>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
833CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
834
835>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
836
837>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
838TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
839
840>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
841VERBOSE:root:This should only be seen at the '5' logging level (or lower)
842
843>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
844SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
845
846>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
847EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
848
849>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
850TERSE:root:This should only be seen at the '8' logging level (or lower)
851
852>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
853TACITURN:root:This should only be seen at the '9' logging level (or lower)
854
855>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
856SILENT:root:This should only be seen at the '10' logging level (or lower)
857
858>>> log.setLevel(3)
859
860>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
861
862>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
863
864>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
865
866>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
867TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
868
869>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
870VERBOSE:root:This should only be seen at the '5' logging level (or lower)
871
872>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
873SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
874
875>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
876EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
877
878>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
879TERSE:root:This should only be seen at the '8' logging level (or lower)
880
881>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
882TACITURN:root:This should only be seen at the '9' logging level (or lower)
883
884>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
885SILENT:root:This should only be seen at the '10' logging level (or lower)
886
887>>> log.setLevel(4)
888
889>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
890
891>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
892
893>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
894
895>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
896TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
897
898>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
899VERBOSE:root:This should only be seen at the '5' logging level (or lower)
900
901>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
902SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
903
904>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
905EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
906
907>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
908TERSE:root:This should only be seen at the '8' logging level (or lower)
909
910>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
911TACITURN:root:This should only be seen at the '9' logging level (or lower)
912
913>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
914SILENT:root:This should only be seen at the '10' logging level (or lower)
915
916>>> log.setLevel(5)
917
918>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
919
920>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
921
922>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
923
924>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
925
926>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
927VERBOSE:root:This should only be seen at the '5' logging level (or lower)
928
929>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
930SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
931
932>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
933EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
934
935>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
936TERSE:root:This should only be seen at the '8' logging level (or lower)
937
938>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
939TACITURN:root:This should only be seen at the '9' logging level (or lower)
940
941>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
942SILENT:root:This should only be seen at the '10' logging level (or lower)
943
944>>> log.setLevel(0)
945
946>>> log.setLevel(6)
947
948>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
949
950>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
951
952>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
953
954>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
955
956>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
957
958>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
959SOCIABLE:root:This should only be seen at the '6' logging level (or lower)
960
961>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
962EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
963
964>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
965TERSE:root:This should only be seen at the '8' logging level (or lower)
966
967>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
968TACITURN:root:This should only be seen at the '9' logging level (or lower)
969
970>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
971SILENT:root:This should only be seen at the '10' logging level (or lower)
972
973>>> log.setLevel(7)
974
975>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
976
977>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
978
979>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
980
981>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
982
983>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
984
985>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
986
987>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
988EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
989
990>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
991TERSE:root:This should only be seen at the '8' logging level (or lower)
992
993>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
994TACITURN:root:This should only be seen at the '9' logging level (or lower)
995
996>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
997SILENT:root:This should only be seen at the '10' logging level (or lower)
998
999>>> log.setLevel(8)
1000
1001>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1002
1003>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1004
1005>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1006
1007>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1008
1009>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1010
1011>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1012
1013>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1014
1015>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1016TERSE:root:This should only be seen at the '8' logging level (or lower)
1017
1018>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1019TACITURN:root:This should only be seen at the '9' logging level (or lower)
1020
1021>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1022SILENT:root:This should only be seen at the '10' logging level (or lower)
1023
1024>>> log.setLevel(9)
1025
1026>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1027
1028>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1029
1030>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1031
1032>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1033
1034>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1035
1036>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1037
1038>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1039
1040>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1041
1042>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1043TACITURN:root:This should only be seen at the '9' logging level (or lower)
1044
1045>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1046SILENT:root:This should only be seen at the '10' logging level (or lower)
1047
1048>>> log.setLevel(10)
1049
1050>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1051
1052>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1053
1054>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1055
1056>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1057
1058>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1059
1060>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1061
1062>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1063
1064>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1065
1066>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1067
1068>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1069SILENT:root:This should only be seen at the '10' logging level (or lower)
1070
1071>>> spec = VerySpecificFilter()
1072
1073>>> log.addFilter(spec)
1074
1075>>> log.setLevel(1)
1076
1077>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1078BORING:root:This should only be seen at the '1' logging level (or lower)
1079
1080>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1081CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
1082
1083>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1084
1085>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1086TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
1087
1088>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1089VERBOSE:root:This should only be seen at the '5' logging level (or lower)
1090
1091>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1092
1093>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1094EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1095
1096>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1097TERSE:root:This should only be seen at the '8' logging level (or lower)
1098
1099>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1100
1101>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1102SILENT:root:This should only be seen at the '10' logging level (or lower)
1103
1104>>> log.setLevel(2)
1105
1106>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1107
1108>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1109CHATTERBOX:root:This should only be seen at the '2' logging level (or lower)
1110
1111>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1112
1113>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1114TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
1115
1116>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1117VERBOSE:root:This should only be seen at the '5' logging level (or lower)
1118
1119>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1120
1121>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1122EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1123
1124>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1125TERSE:root:This should only be seen at the '8' logging level (or lower)
1126
1127>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1128
1129>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1130SILENT:root:This should only be seen at the '10' logging level (or lower)
1131
1132>>> log.setLevel(3)
1133
1134>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1135
1136>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1137
1138>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1139
1140>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1141TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
1142
1143>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1144VERBOSE:root:This should only be seen at the '5' logging level (or lower)
1145
1146>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1147
1148>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1149EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1150
1151>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1152TERSE:root:This should only be seen at the '8' logging level (or lower)
1153
1154>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1155
1156>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1157SILENT:root:This should only be seen at the '10' logging level (or lower)
1158
1159>>> log.setLevel(4)
1160
1161>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1162
1163>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1164
1165>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1166
1167>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1168TALKATIVE:root:This should only be seen at the '4' logging level (or lower)
1169
1170>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1171VERBOSE:root:This should only be seen at the '5' logging level (or lower)
1172
1173>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1174
1175>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1176EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1177
1178>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1179TERSE:root:This should only be seen at the '8' logging level (or lower)
1180
1181>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1182
1183>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1184SILENT:root:This should only be seen at the '10' logging level (or lower)
1185
1186>>> log.setLevel(5)
1187
1188>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1189
1190>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1191
1192>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1193
1194>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1195
1196>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1197VERBOSE:root:This should only be seen at the '5' logging level (or lower)
1198
1199>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1200
1201>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1202EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1203
1204>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1205TERSE:root:This should only be seen at the '8' logging level (or lower)
1206
1207>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1208
1209>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1210SILENT:root:This should only be seen at the '10' logging level (or lower)
1211
1212>>> log.setLevel(6)
1213
1214>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1215
1216>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1217
1218>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1219
1220>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1221
1222>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1223
1224>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1225
1226>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1227EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1228
1229>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1230TERSE:root:This should only be seen at the '8' logging level (or lower)
1231
1232>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1233
1234>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1235SILENT:root:This should only be seen at the '10' logging level (or lower)
1236
1237>>> log.setLevel(7)
1238
1239>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1240
1241>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1242
1243>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1244
1245>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1246
1247>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1248
1249>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1250
1251>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1252EFFUSIVE:root:This should only be seen at the '7' logging level (or lower)
1253
1254>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1255TERSE:root:This should only be seen at the '8' logging level (or lower)
1256
1257>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1258
1259>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1260SILENT:root:This should only be seen at the '10' logging level (or lower)
1261
1262>>> log.setLevel(8)
1263
1264>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1265
1266>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1267
1268>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1269
1270>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1271
1272>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1273
1274>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1275
1276>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1277
1278>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1279TERSE:root:This should only be seen at the '8' logging level (or lower)
1280
1281>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1282
1283>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1284SILENT:root:This should only be seen at the '10' logging level (or lower)
1285
1286>>> log.setLevel(9)
1287
1288>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1289
1290>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1291
1292>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1293
1294>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1295
1296>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1297
1298>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1299
1300>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1301
1302>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1303
1304>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1305
1306>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1307SILENT:root:This should only be seen at the '10' logging level (or lower)
1308
1309>>> log.setLevel(10)
1310
1311>>> log.log(1, "This should only be seen at the '%s' logging level (or lower)", BORING)
1312
1313>>> log.log(2, "This should only be seen at the '%s' logging level (or lower)", CHATTERBOX)
1314
1315>>> log.log(3, "This should only be seen at the '%s' logging level (or lower)", GARRULOUS)
1316
1317>>> log.log(4, "This should only be seen at the '%s' logging level (or lower)", TALKATIVE)
1318
1319>>> log.log(5, "This should only be seen at the '%s' logging level (or lower)", VERBOSE)
1320
1321>>> log.log(6, "This should only be seen at the '%s' logging level (or lower)", SOCIABLE)
1322
1323>>> log.log(7, "This should only be seen at the '%s' logging level (or lower)", EFFUSIVE)
1324
1325>>> log.log(8, "This should only be seen at the '%s' logging level (or lower)", TERSE)
1326
1327>>> log.log(9, "This should only be seen at the '%s' logging level (or lower)", TACITURN)
1328
1329>>> log.log(10, "This should only be seen at the '%s' logging level (or lower)", SILENT)
1330SILENT:root:This should only be seen at the '10' logging level (or lower)
1331
1332>>> log.setLevel(0)
1333
1334>>> log.removeFilter(spec)
1335
1336>>> hdlr.removeFilter(garr)
1337
1338>>> logging.addLevelName(logging.DEBUG, "DEBUG")
1339
1340
1341Test 2
1342======
1343Test memory handlers. These are basically buffers for log messages: they take so many messages, and then print them all.
1344
1345>>> import logging.handlers
1346
1347>>> sys.stderr = sys.stdout
1348>>> logger = logging.getLogger("")
1349>>> sh = logger.handlers[0]
1350>>> sh.close()
1351>>> logger.removeHandler(sh)
1352>>> mh = logging.handlers.MemoryHandler(10,logging.WARNING, sh)
1353>>> logger.setLevel(logging.DEBUG)
1354>>> logger.addHandler(mh)
1355
1356>>> logger.debug("Debug message")
1357
1358-- logging at INFO, nothing should be seen yet --
1359
1360>>> logger.info("Info message")
1361
1362-- logging at WARNING, 3 messages should be seen --
1363
1364>>> logger.warn("Warn message")
1365DEBUG:root:Debug message
1366INFO:root:Info message
1367WARNING:root:Warn message
1368
1369>>> logger.info("Info index = 0")
1370
1371>>> logger.info("Info index = 1")
1372
1373>>> logger.info("Info index = 2")
1374
1375>>> logger.info("Info index = 3")
1376
1377>>> logger.info("Info index = 4")
1378
1379>>> logger.info("Info index = 5")
1380
1381>>> logger.info("Info index = 6")
1382
1383>>> logger.info("Info index = 7")
1384
1385>>> logger.info("Info index = 8")
1386
1387>>> logger.info("Info index = 9")
1388INFO:root:Info index = 0
1389INFO:root:Info index = 1
1390INFO:root:Info index = 2
1391INFO:root:Info index = 3
1392INFO:root:Info index = 4
1393INFO:root:Info index = 5
1394INFO:root:Info index = 6
1395INFO:root:Info index = 7
1396INFO:root:Info index = 8
1397INFO:root:Info index = 9
1398
1399>>> logger.info("Info index = 10")
1400
1401>>> logger.info("Info index = 11")
1402
1403>>> logger.info("Info index = 12")
1404
1405>>> logger.info("Info index = 13")
1406
1407>>> logger.info("Info index = 14")
1408
1409>>> logger.info("Info index = 15")
1410
1411>>> logger.info("Info index = 16")
1412
1413>>> logger.info("Info index = 17")
1414
1415>>> logger.info("Info index = 18")
1416
1417>>> logger.info("Info index = 19")
1418INFO:root:Info index = 10
1419INFO:root:Info index = 11
1420INFO:root:Info index = 12
1421INFO:root:Info index = 13
1422INFO:root:Info index = 14
1423INFO:root:Info index = 15
1424INFO:root:Info index = 16
1425INFO:root:Info index = 17
1426INFO:root:Info index = 18
1427INFO:root:Info index = 19
1428
1429>>> logger.info("Info index = 20")
1430
1431>>> logger.info("Info index = 21")
1432
1433>>> logger.info("Info index = 22")
1434
1435>>> logger.info("Info index = 23")
1436
1437>>> logger.info("Info index = 24")
1438
1439>>> logger.info("Info index = 25")
1440
1441>>> logger.info("Info index = 26")
1442
1443>>> logger.info("Info index = 27")
1444
1445>>> logger.info("Info index = 28")
1446
1447>>> logger.info("Info index = 29")
1448INFO:root:Info index = 20
1449INFO:root:Info index = 21
1450INFO:root:Info index = 22
1451INFO:root:Info index = 23
1452INFO:root:Info index = 24
1453INFO:root:Info index = 25
1454INFO:root:Info index = 26
1455INFO:root:Info index = 27
1456INFO:root:Info index = 28
1457INFO:root:Info index = 29
1458
1459>>> logger.info("Info index = 30")
1460
1461>>> logger.info("Info index = 31")
1462
1463>>> logger.info("Info index = 32")
1464
1465>>> logger.info("Info index = 33")
1466
1467>>> logger.info("Info index = 34")
1468
1469>>> logger.info("Info index = 35")
1470
1471>>> logger.info("Info index = 36")
1472
1473>>> logger.info("Info index = 37")
1474
1475>>> logger.info("Info index = 38")
1476
1477>>> logger.info("Info index = 39")
1478INFO:root:Info index = 30
1479INFO:root:Info index = 31
1480INFO:root:Info index = 32
1481INFO:root:Info index = 33
1482INFO:root:Info index = 34
1483INFO:root:Info index = 35
1484INFO:root:Info index = 36
1485INFO:root:Info index = 37
1486INFO:root:Info index = 38
1487INFO:root:Info index = 39
1488
1489>>> logger.info("Info index = 40")
1490
1491>>> logger.info("Info index = 41")
1492
1493>>> logger.info("Info index = 42")
1494
1495>>> logger.info("Info index = 43")
1496
1497>>> logger.info("Info index = 44")
1498
1499>>> logger.info("Info index = 45")
1500
1501>>> logger.info("Info index = 46")
1502
1503>>> logger.info("Info index = 47")
1504
1505>>> logger.info("Info index = 48")
1506
1507>>> logger.info("Info index = 49")
1508INFO:root:Info index = 40
1509INFO:root:Info index = 41
1510INFO:root:Info index = 42
1511INFO:root:Info index = 43
1512INFO:root:Info index = 44
1513INFO:root:Info index = 45
1514INFO:root:Info index = 46
1515INFO:root:Info index = 47
1516INFO:root:Info index = 48
1517INFO:root:Info index = 49
1518
1519>>> logger.info("Info index = 50")
1520
1521>>> logger.info("Info index = 51")
1522
1523>>> logger.info("Info index = 52")
1524
1525>>> logger.info("Info index = 53")
1526
1527>>> logger.info("Info index = 54")
1528
1529>>> logger.info("Info index = 55")
1530
1531>>> logger.info("Info index = 56")
1532
1533>>> logger.info("Info index = 57")
1534
1535>>> logger.info("Info index = 58")
1536
1537>>> logger.info("Info index = 59")
1538INFO:root:Info index = 50
1539INFO:root:Info index = 51
1540INFO:root:Info index = 52
1541INFO:root:Info index = 53
1542INFO:root:Info index = 54
1543INFO:root:Info index = 55
1544INFO:root:Info index = 56
1545INFO:root:Info index = 57
1546INFO:root:Info index = 58
1547INFO:root:Info index = 59
1548
1549>>> logger.info("Info index = 60")
1550
1551>>> logger.info("Info index = 61")
1552
1553>>> logger.info("Info index = 62")
1554
1555>>> logger.info("Info index = 63")
1556
1557>>> logger.info("Info index = 64")
1558
1559>>> logger.info("Info index = 65")
1560
1561>>> logger.info("Info index = 66")
1562
1563>>> logger.info("Info index = 67")
1564
1565>>> logger.info("Info index = 68")
1566
1567>>> logger.info("Info index = 69")
1568INFO:root:Info index = 60
1569INFO:root:Info index = 61
1570INFO:root:Info index = 62
1571INFO:root:Info index = 63
1572INFO:root:Info index = 64
1573INFO:root:Info index = 65
1574INFO:root:Info index = 66
1575INFO:root:Info index = 67
1576INFO:root:Info index = 68
1577INFO:root:Info index = 69
1578
1579>>> logger.info("Info index = 70")
1580
1581>>> logger.info("Info index = 71")
1582
1583>>> logger.info("Info index = 72")
1584
1585>>> logger.info("Info index = 73")
1586
1587>>> logger.info("Info index = 74")
1588
1589>>> logger.info("Info index = 75")
1590
1591>>> logger.info("Info index = 76")
1592
1593>>> logger.info("Info index = 77")
1594
1595>>> logger.info("Info index = 78")
1596
1597>>> logger.info("Info index = 79")
1598INFO:root:Info index = 70
1599INFO:root:Info index = 71
1600INFO:root:Info index = 72
1601INFO:root:Info index = 73
1602INFO:root:Info index = 74
1603INFO:root:Info index = 75
1604INFO:root:Info index = 76
1605INFO:root:Info index = 77
1606INFO:root:Info index = 78
1607INFO:root:Info index = 79
1608
1609>>> logger.info("Info index = 80")
1610
1611>>> logger.info("Info index = 81")
1612
1613>>> logger.info("Info index = 82")
1614
1615>>> logger.info("Info index = 83")
1616
1617>>> logger.info("Info index = 84")
1618
1619>>> logger.info("Info index = 85")
1620
1621>>> logger.info("Info index = 86")
1622
1623>>> logger.info("Info index = 87")
1624
1625>>> logger.info("Info index = 88")
1626
1627>>> logger.info("Info index = 89")
1628INFO:root:Info index = 80
1629INFO:root:Info index = 81
1630INFO:root:Info index = 82
1631INFO:root:Info index = 83
1632INFO:root:Info index = 84
1633INFO:root:Info index = 85
1634INFO:root:Info index = 86
1635INFO:root:Info index = 87
1636INFO:root:Info index = 88
1637INFO:root:Info index = 89
1638
1639>>> logger.info("Info index = 90")
1640
1641>>> logger.info("Info index = 91")
1642
1643>>> logger.info("Info index = 92")
1644
1645>>> logger.info("Info index = 93")
1646
1647>>> logger.info("Info index = 94")
1648
1649>>> logger.info("Info index = 95")
1650
1651>>> logger.info("Info index = 96")
1652
1653>>> logger.info("Info index = 97")
1654
1655>>> logger.info("Info index = 98")
1656
1657>>> logger.info("Info index = 99")
1658INFO:root:Info index = 90
1659INFO:root:Info index = 91
1660INFO:root:Info index = 92
1661INFO:root:Info index = 93
1662INFO:root:Info index = 94
1663INFO:root:Info index = 95
1664INFO:root:Info index = 96
1665INFO:root:Info index = 97
1666INFO:root:Info index = 98
1667INFO:root:Info index = 99
1668
1669>>> logger.info("Info index = 100")
1670
1671>>> logger.info("Info index = 101")
1672
1673>>> mh.close()
1674INFO:root:Info index = 100
1675INFO:root:Info index = 101
1676
1677>>> logger.removeHandler(mh)
1678>>> logger.addHandler(sh)
1679
1680
1681
1682Test 3
1683======
1684
1685>>> import sys, logging
1686>>> sys.stderr = sys
1687>>> logging.basicConfig()
1688>>> FILTER = "a.b"
1689>>> root = logging.getLogger()
1690>>> root.setLevel(logging.DEBUG)
1691>>> hand = root.handlers[0]
1692
1693>>> logging.getLogger("a").info("Info 1")
1694INFO:a:Info 1
1695
1696>>> logging.getLogger("a.b").info("Info 2")
1697INFO:a.b:Info 2
1698
1699>>> logging.getLogger("a.c").info("Info 3")
1700INFO:a.c:Info 3
1701
1702>>> logging.getLogger("a.b.c").info("Info 4")
1703INFO:a.b.c:Info 4
1704
1705>>> logging.getLogger("a.b.c.d").info("Info 5")
1706INFO:a.b.c.d:Info 5
1707
1708>>> logging.getLogger("a.bb.c").info("Info 6")
1709INFO:a.bb.c:Info 6
1710
1711>>> logging.getLogger("b").info("Info 7")
1712INFO:b:Info 7
1713
1714>>> logging.getLogger("b.a").info("Info 8")
1715INFO:b.a:Info 8
1716
1717>>> logging.getLogger("c.a.b").info("Info 9")
1718INFO:c.a.b:Info 9
1719
1720>>> logging.getLogger("a.bb").info("Info 10")
1721INFO:a.bb:Info 10
1722
1723Filtered with 'a.b'...
1724
1725>>> filt = logging.Filter(FILTER)
1726
1727>>> hand.addFilter(filt)
1728
1729>>> logging.getLogger("a").info("Info 1")
1730
1731>>> logging.getLogger("a.b").info("Info 2")
1732INFO:a.b:Info 2
1733
1734>>> logging.getLogger("a.c").info("Info 3")
1735
1736>>> logging.getLogger("a.b.c").info("Info 4")
1737INFO:a.b.c:Info 4
1738
1739>>> logging.getLogger("a.b.c.d").info("Info 5")
1740INFO:a.b.c.d:Info 5
1741
1742>>> logging.getLogger("a.bb.c").info("Info 6")
1743
1744>>> logging.getLogger("b").info("Info 7")
1745
1746>>> logging.getLogger("b.a").info("Info 8")
1747
1748>>> logging.getLogger("c.a.b").info("Info 9")
1749
1750>>> logging.getLogger("a.bb").info("Info 10")
1751
1752>>> hand.removeFilter(filt)
1753
1754
1755Test 4
1756======
1757>>> import sys, logging, logging.handlers, string
1758>>> import tempfile, logging.config, os, test.test_support
1759>>> sys.stderr = sys.stdout
1760
1761>>> from test_logging import config0, config1
1762
1763config2 has a subtle configuration error that should be reported
1764>>> config2 = string.replace(config1, "sys.stdout", "sys.stbout")
1765
1766config3 has a less subtle configuration error
1767>>> config3 = string.replace(config1, "formatter=form1", "formatter=misspelled_name")
1768
1769>>> def test4(conf):
1770... loggerDict = logging.getLogger().manager.loggerDict
1771... logging._acquireLock()
1772... try:
1773... saved_handlers = logging._handlers.copy()
1774... saved_handler_list = logging._handlerList[:]
1775... saved_loggers = loggerDict.copy()
1776... finally:
1777... logging._releaseLock()
1778... try:
1779... fn = test.test_support.TESTFN
1780... f = open(fn, "w")
1781... f.write(conf)
1782... f.close()
1783... try:
1784... logging.config.fileConfig(fn)
1785... #call again to make sure cleanup is correct
1786... logging.config.fileConfig(fn)
1787... except:
1788... t = sys.exc_info()[0]
1789... message(str(t))
1790... else:
1791... message('ok.')
1792... os.remove(fn)
1793... finally:
1794... logging._acquireLock()
1795... try:
1796... logging._handlers.clear()
1797... logging._handlers.update(saved_handlers)
1798... logging._handlerList[:] = saved_handler_list
1799... loggerDict = logging.getLogger().manager.loggerDict
1800... loggerDict.clear()
1801... loggerDict.update(saved_loggers)
1802... finally:
1803... logging._releaseLock()
1804
1805>>> test4(config0)
1806ok.
1807
1808>>> test4(config1)
1809ok.
1810
1811>>> test4(config2)
1812<type 'exceptions.AttributeError'>
1813
1814>>> test4(config3)
1815<type 'exceptions.KeyError'>
1816
1817>>> import test_logging
1818>>> test_logging.test5()
1819ERROR:root:just testing
1820<type 'exceptions.KeyError'>... Don't panic!
1821
1822
1823Test Main
1824=========
1825>>> import select
1826>>> import os, sys, string, struct, types, cPickle, cStringIO
1827>>> import socket, tempfile, threading, time
1828>>> import logging, logging.handlers, logging.config
1829>>> import test_logging
1830
1831>>> test_logging.test_main_inner()
1832ERR -> CRITICAL: Message 0 (via logrecv.tcp.ERR)
1833ERR -> ERROR: Message 1 (via logrecv.tcp.ERR)
1834INF -> CRITICAL: Message 2 (via logrecv.tcp.INF)
1835INF -> ERROR: Message 3 (via logrecv.tcp.INF)
1836INF -> WARNING: Message 4 (via logrecv.tcp.INF)
1837INF -> INFO: Message 5 (via logrecv.tcp.INF)
1838INF.UNDEF -> CRITICAL: Message 6 (via logrecv.tcp.INF.UNDEF)
1839INF.UNDEF -> ERROR: Message 7 (via logrecv.tcp.INF.UNDEF)
1840INF.UNDEF -> WARNING: Message 8 (via logrecv.tcp.INF.UNDEF)
1841INF.UNDEF -> INFO: Message 9 (via logrecv.tcp.INF.UNDEF)
1842INF.ERR -> CRITICAL: Message 10 (via logrecv.tcp.INF.ERR)
1843INF.ERR -> ERROR: Message 11 (via logrecv.tcp.INF.ERR)
1844INF.ERR.UNDEF -> CRITICAL: Message 12 (via logrecv.tcp.INF.ERR.UNDEF)
1845INF.ERR.UNDEF -> ERROR: Message 13 (via logrecv.tcp.INF.ERR.UNDEF)
1846DEB -> CRITICAL: Message 14 (via logrecv.tcp.DEB)
1847DEB -> ERROR: Message 15 (via logrecv.tcp.DEB)
1848DEB -> WARNING: Message 16 (via logrecv.tcp.DEB)
1849DEB -> INFO: Message 17 (via logrecv.tcp.DEB)
1850DEB -> DEBUG: Message 18 (via logrecv.tcp.DEB)
1851UNDEF -> CRITICAL: Message 19 (via logrecv.tcp.UNDEF)
1852UNDEF -> ERROR: Message 20 (via logrecv.tcp.UNDEF)
1853UNDEF -> WARNING: Message 21 (via logrecv.tcp.UNDEF)
1854UNDEF -> INFO: Message 22 (via logrecv.tcp.UNDEF)
1855INF.BADPARENT.UNDEF -> CRITICAL: Message 23 (via logrecv.tcp.INF.BADPARENT.UNDEF)
1856INF.BADPARENT -> CRITICAL: Message 24 (via logrecv.tcp.INF.BADPARENT)
1857INF -> INFO: Finish up, it's closing time. Messages should bear numbers 0 through 24. (via logrecv.tcp.INF)
1858<BLANKLINE>
1859"""
Guido van Rossum2a1d5162003-01-21 21:05:22 +00001860import select
Christian Heimesc5f05e42008-02-23 17:40:11 +00001861import os, sys, string, struct, cPickle, cStringIO
1862import socket, threading
Brett Cannonf9db8a32008-02-17 01:59:18 +00001863import logging, logging.handlers, logging.config, test.test_support
1864
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001865
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001866BANNER = "-- %-10s %-6s ---------------------------------------------------\n"
1867
Guido van Rossum376e6362003-04-25 14:22:00 +00001868FINISH_UP = "Finish up, it's closing time. Messages should bear numbers 0 through 24."
Brett Cannonf9db8a32008-02-17 01:59:18 +00001869#----------------------------------------------------------------------------
1870# Test 0
1871#----------------------------------------------------------------------------
1872
1873msgcount = 0
1874
1875def nextmessage():
1876 global msgcount
1877 rv = "Message %d" % msgcount
1878 msgcount = msgcount + 1
1879 return rv
Guido van Rossum376e6362003-04-25 14:22:00 +00001880
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001881#----------------------------------------------------------------------------
1882# Log receiver
1883#----------------------------------------------------------------------------
1884
1885TIMEOUT = 10
1886
1887from SocketServer import ThreadingTCPServer, StreamRequestHandler
1888
1889class LogRecordStreamHandler(StreamRequestHandler):
1890 """
1891 Handler for a streaming logging request. It basically logs the record
1892 using whatever logging policy is configured locally.
1893 """
1894
1895 def handle(self):
1896 """
1897 Handle multiple requests - each expected to be a 4-byte length,
1898 followed by the LogRecord in pickle format. Logs the record
1899 according to whatever policy is configured locally.
1900 """
1901 while 1:
1902 try:
1903 chunk = self.connection.recv(4)
1904 if len(chunk) < 4:
1905 break
1906 slen = struct.unpack(">L", chunk)[0]
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001907 chunk = self.connection.recv(slen)
1908 while len(chunk) < slen:
1909 chunk = chunk + self.connection.recv(slen - len(chunk))
1910 obj = self.unPickle(chunk)
Raymond Hettinger6f3eaa62003-06-27 21:43:39 +00001911 record = logging.makeLogRecord(obj)
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001912 self.handleLogRecord(record)
1913 except:
1914 raise
1915
1916 def unPickle(self, data):
1917 return cPickle.loads(data)
1918
1919 def handleLogRecord(self, record):
1920 logname = "logrecv.tcp." + record.name
Guido van Rossum376e6362003-04-25 14:22:00 +00001921 #If the end-of-messages sentinel is seen, tell the server to terminate
1922 if record.msg == FINISH_UP:
1923 self.server.abort = 1
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001924 record.msg = record.msg + " (via " + logname + ")"
Brett Cannonf9db8a32008-02-17 01:59:18 +00001925 logger = logging.getLogger("logrecv")
Neal Norwitzb4a2df02003-01-02 14:56:39 +00001926 logger.handle(record)
1927
Brett Cannonf9addb62003-04-30 05:32:32 +00001928# The server sets socketDataProcessed when it's done.
1929socketDataProcessed = threading.Event()
Brett Cannonf9db8a32008-02-17 01:59:18 +00001930#----------------------------------------------------------------------------
1931# Test 5
1932#----------------------------------------------------------------------------
1933
1934test5_config = """
1935[loggers]
1936keys=root
1937
1938[handlers]
1939keys=hand1
1940
1941[formatters]
1942keys=form1
1943
1944[logger_root]
1945level=NOTSET
1946handlers=hand1
1947
1948[handler_hand1]
1949class=StreamHandler
1950level=NOTSET
1951formatter=form1
1952args=(sys.stdout,)
1953
1954[formatter_form1]
1955class=test.test_logging.FriendlyFormatter
1956format=%(levelname)s:%(name)s:%(message)s
1957datefmt=
1958"""
1959
1960class FriendlyFormatter (logging.Formatter):
1961 def formatException(self, ei):
1962 return "%s... Don't panic!" % str(ei[0])
1963
1964
1965def test5():
1966 loggerDict = logging.getLogger().manager.loggerDict
1967 logging._acquireLock()
1968 try:
1969 saved_handlers = logging._handlers.copy()
1970 saved_handler_list = logging._handlerList[:]
1971 saved_loggers = loggerDict.copy()
1972 finally:
1973 logging._releaseLock()
1974 try:
1975 fn = test.test_support.TESTFN
1976 f = open(fn, "w")
1977 f.write(test5_config)
1978 f.close()
1979 logging.config.fileConfig(fn)
1980 try:
1981 raise KeyError
1982 except KeyError:
1983 logging.exception("just testing")
1984 os.remove(fn)
1985 hdlr = logging.getLogger().handlers[0]
1986 logging.getLogger().handlers.remove(hdlr)
1987 finally:
1988 logging._acquireLock()
1989 try:
1990 logging._handlers.clear()
1991 logging._handlers.update(saved_handlers)
1992 logging._handlerList[:] = saved_handler_list
1993 loggerDict = logging.getLogger().manager.loggerDict
1994 loggerDict.clear()
1995 loggerDict.update(saved_loggers)
1996 finally:
1997 logging._releaseLock()
1998
Guido van Rossum376e6362003-04-25 14:22:00 +00001999
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002000class LogRecordSocketReceiver(ThreadingTCPServer):
2001 """
2002 A simple-minded TCP socket-based logging receiver suitable for test
2003 purposes.
2004 """
2005
2006 allow_reuse_address = 1
2007
2008 def __init__(self, host='localhost',
2009 port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
2010 handler=LogRecordStreamHandler):
2011 ThreadingTCPServer.__init__(self, (host, port), handler)
Georg Brandl57826cf2008-02-23 15:06:25 +00002012 self.abort = False
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002013 self.timeout = 1
2014
2015 def serve_until_stopped(self):
Neal Norwitz55cd82f2006-02-05 08:21:08 +00002016 while not self.abort:
Neal Norwitz5bab0f82006-03-05 02:16:12 +00002017 rd, wr, ex = select.select([self.socket.fileno()], [], [],
2018 self.timeout)
2019 if rd:
2020 self.handle_request()
Georg Brandl57826cf2008-02-23 15:06:25 +00002021 socketDataProcessed.set()
Martin v. Löwisf6848882006-01-29 19:55:18 +00002022 # close the listen socket
2023 self.server_close()
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002024
Guido van Rossum2a1d5162003-01-21 21:05:22 +00002025 def process_request(self, request, client_address):
Guido van Rossum2a1d5162003-01-21 21:05:22 +00002026 t = threading.Thread(target = self.finish_request,
2027 args = (request, client_address))
2028 t.start()
2029
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002030def runTCP(tcpserver):
2031 tcpserver.serve_until_stopped()
2032
Brett Cannonf9db8a32008-02-17 01:59:18 +00002033def banner(nm, typ):
2034 sep = BANNER % (nm, typ)
2035 sys.stdout.write(sep)
2036 sys.stdout.flush()
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002037
2038def test0():
2039 ERR = logging.getLogger("ERR")
2040 ERR.setLevel(logging.ERROR)
2041 INF = logging.getLogger("INF")
2042 INF.setLevel(logging.INFO)
2043 INF_ERR = logging.getLogger("INF.ERR")
2044 INF_ERR.setLevel(logging.ERROR)
2045 DEB = logging.getLogger("DEB")
2046 DEB.setLevel(logging.DEBUG)
2047
2048 INF_UNDEF = logging.getLogger("INF.UNDEF")
2049 INF_ERR_UNDEF = logging.getLogger("INF.ERR.UNDEF")
2050 UNDEF = logging.getLogger("UNDEF")
2051
2052 GRANDCHILD = logging.getLogger("INF.BADPARENT.UNDEF")
2053 CHILD = logging.getLogger("INF.BADPARENT")
2054
2055 #These should log
2056 ERR.log(logging.FATAL, nextmessage())
2057 ERR.error(nextmessage())
2058
2059 INF.log(logging.FATAL, nextmessage())
2060 INF.error(nextmessage())
2061 INF.warn(nextmessage())
2062 INF.info(nextmessage())
2063
2064 INF_UNDEF.log(logging.FATAL, nextmessage())
2065 INF_UNDEF.error(nextmessage())
2066 INF_UNDEF.warn (nextmessage())
2067 INF_UNDEF.info (nextmessage())
2068
2069 INF_ERR.log(logging.FATAL, nextmessage())
2070 INF_ERR.error(nextmessage())
2071
2072 INF_ERR_UNDEF.log(logging.FATAL, nextmessage())
2073 INF_ERR_UNDEF.error(nextmessage())
2074
2075 DEB.log(logging.FATAL, nextmessage())
2076 DEB.error(nextmessage())
2077 DEB.warn (nextmessage())
2078 DEB.info (nextmessage())
2079 DEB.debug(nextmessage())
2080
2081 UNDEF.log(logging.FATAL, nextmessage())
2082 UNDEF.error(nextmessage())
2083 UNDEF.warn (nextmessage())
2084 UNDEF.info (nextmessage())
2085
2086 GRANDCHILD.log(logging.FATAL, nextmessage())
2087 CHILD.log(logging.FATAL, nextmessage())
2088
2089 #These should not log
2090 ERR.warn(nextmessage())
2091 ERR.info(nextmessage())
2092 ERR.debug(nextmessage())
2093
2094 INF.debug(nextmessage())
2095 INF_UNDEF.debug(nextmessage())
2096
2097 INF_ERR.warn(nextmessage())
2098 INF_ERR.info(nextmessage())
2099 INF_ERR.debug(nextmessage())
2100 INF_ERR_UNDEF.warn(nextmessage())
2101 INF_ERR_UNDEF.info(nextmessage())
2102 INF_ERR_UNDEF.debug(nextmessage())
2103
Guido van Rossum376e6362003-04-25 14:22:00 +00002104 INF.info(FINISH_UP)
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002105
Brett Cannonf9db8a32008-02-17 01:59:18 +00002106def test_main_inner():
2107 rootLogger = logging.getLogger("")
2108 rootLogger.setLevel(logging.DEBUG)
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002109
Georg Brandl57826cf2008-02-23 15:06:25 +00002110 tcpserver = LogRecordSocketReceiver(port=0)
2111 port = tcpserver.socket.getsockname()[1]
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002112
Georg Brandl57826cf2008-02-23 15:06:25 +00002113 # Set up a handler such that all events are sent via a socket to the log
2114 # receiver (logrecv).
2115 # The handler will only be added to the rootLogger for some of the tests
Brett Cannonf9db8a32008-02-17 01:59:18 +00002116 shdlr = logging.handlers.SocketHandler('localhost', port)
2117 rootLogger.addHandler(shdlr)
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002118
Georg Brandl57826cf2008-02-23 15:06:25 +00002119 # Configure the logger for logrecv so events do not propagate beyond it.
2120 # The sockLogger output is buffered in memory until the end of the test,
2121 # and printed at the end.
Brett Cannonf9db8a32008-02-17 01:59:18 +00002122 sockOut = cStringIO.StringIO()
2123 sockLogger = logging.getLogger("logrecv")
2124 sockLogger.setLevel(logging.DEBUG)
2125 sockhdlr = logging.StreamHandler(sockOut)
2126 sockhdlr.setFormatter(logging.Formatter(
2127 "%(name)s -> %(levelname)s: %(message)s"))
2128 sockLogger.addHandler(sockhdlr)
2129 sockLogger.propagate = 0
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002130
Brett Cannonf9db8a32008-02-17 01:59:18 +00002131 #Set up servers
2132 threads = []
2133 #sys.stdout.write("About to start TCP server...\n")
2134 threads.append(threading.Thread(target=runTCP, args=(tcpserver,)))
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002135
Brett Cannonf9db8a32008-02-17 01:59:18 +00002136 for thread in threads:
2137 thread.start()
2138 try:
2139 test0()
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002140
Brett Cannonf9db8a32008-02-17 01:59:18 +00002141 # XXX(nnorwitz): Try to fix timing related test failures.
2142 # This sleep gives us some extra time to read messages.
2143 # The test generally only fails on Solaris without this sleep.
2144 #time.sleep(2.0)
2145 shdlr.close()
2146 rootLogger.removeHandler(shdlr)
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002147
Brett Cannonf9db8a32008-02-17 01:59:18 +00002148 finally:
2149 #wait for TCP receiver to terminate
Georg Brandl57826cf2008-02-23 15:06:25 +00002150 socketDataProcessed.wait()
Brett Cannonf9db8a32008-02-17 01:59:18 +00002151 # ensure the server dies
Georg Brandl57826cf2008-02-23 15:06:25 +00002152 tcpserver.abort = True
Brett Cannonf9db8a32008-02-17 01:59:18 +00002153 for thread in threads:
2154 thread.join(2.0)
2155 print(sockOut.getvalue())
2156 sockOut.close()
2157 sockLogger.removeHandler(sockhdlr)
2158 sockhdlr.close()
2159 sys.stdout.flush()
Vinay Sajip22b25aa2006-01-16 21:24:38 +00002160
Vinay Sajip568482a2006-01-20 18:29:36 +00002161# config0 is a standard configuration.
Vinay Sajip22b25aa2006-01-16 21:24:38 +00002162config0 = """
2163[loggers]
2164keys=root
2165
2166[handlers]
2167keys=hand1
2168
2169[formatters]
2170keys=form1
2171
2172[logger_root]
2173level=NOTSET
2174handlers=hand1
2175
2176[handler_hand1]
2177class=StreamHandler
2178level=NOTSET
2179formatter=form1
2180args=(sys.stdout,)
2181
2182[formatter_form1]
2183format=%(levelname)s:%(name)s:%(message)s
2184datefmt=
2185"""
2186
2187# config1 adds a little to the standard configuration.
2188config1 = """
2189[loggers]
2190keys=root,parser
2191
2192[handlers]
2193keys=hand1
2194
2195[formatters]
2196keys=form1
2197
2198[logger_root]
2199level=NOTSET
2200handlers=hand1
2201
2202[logger_parser]
2203level=DEBUG
2204handlers=hand1
2205propagate=1
2206qualname=compiler.parser
2207
2208[handler_hand1]
2209class=StreamHandler
2210level=NOTSET
2211formatter=form1
2212args=(sys.stdout,)
2213
2214[formatter_form1]
2215format=%(levelname)s:%(name)s:%(message)s
2216datefmt=
2217"""
2218
Brett Cannonf9db8a32008-02-17 01:59:18 +00002219def message(s):
2220 sys.stdout.write("%s\n" % s)
2221
Vinay Sajip22b25aa2006-01-16 21:24:38 +00002222# config2 has a subtle configuration error that should be reported
2223config2 = string.replace(config1, "sys.stdout", "sys.stbout")
2224
2225# config3 has a less subtle configuration error
2226config3 = string.replace(
2227 config1, "formatter=form1", "formatter=misspelled_name")
2228
Tim Peters36f7e932003-07-23 00:05:07 +00002229def test_main():
Brett Cannonf9db8a32008-02-17 01:59:18 +00002230 from test import test_support, test_logging
2231 test_support.run_doctest(test_logging)
Jeremy Hylton096d9862003-07-18 03:19:20 +00002232
Brett Cannonf9db8a32008-02-17 01:59:18 +00002233if __name__=="__main__":
Neal Norwitzb4a2df02003-01-02 14:56:39 +00002234 test_main()