This file is indexed.

/usr/lib/python2.7/dist-packages/zope/testing/loggingsupport.txt is in python-zope.testing 4.1.2-0ubuntu7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Support for testing logging code
================================

If you want to test that your code generates proper log output, you
can create and install a handler that collects output:

  >>> from zope.testing.loggingsupport import InstalledHandler
  >>> handler = InstalledHandler('foo.bar')

The handler is installed into loggers for all of the names passed. In
addition, the logger level is set to 1, which means, log
everything. If you want to log less than everything, you can provide a
level keyword argument.  The level setting effects only the named
loggers.

  >>> import logging
  >>> handler_with_levels = InstalledHandler('baz', level=logging.WARNING)

Then, any log output is collected in the handler:

  >>> logging.getLogger('foo.bar').exception('eek')
  >>> logging.getLogger('foo.bar').info('blah blah')

  >>> for record in handler.records:
  ...     print_(record.name, record.levelname)
  ...     print_(' ', record.getMessage())
  foo.bar ERROR
    eek
  foo.bar INFO
    blah blah

A similar effect can be gotten by just printing the handler:

  >>> print_(handler)
  foo.bar ERROR
    eek
  foo.bar INFO
    blah blah

After checking the log output, you need to uninstall the handler:

  >>> handler.uninstall()
  >>> handler_with_levels.uninstall()

At which point, the handler won't get any more log output.
Let's clear the handler:

  >>> handler.clear()
  >>> handler.records
  []

And then log something:

  >>> logging.getLogger('foo.bar').info('blah')

and, sure enough, we still have no output:

  >>> handler.records
  []