Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_logging.ConfigDictTest Class Reference
Inheritance diagram for test.test_logging.ConfigDictTest:
Inheritance graph
[legend]
Collaboration diagram for test.test_logging.ConfigDictTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def apply_config
def test_config0_ok
def test_config1_ok
def test_config2_failure
def test_config2a_failure
def test_config2b_failure
def test_config3_failure
def test_config4_ok
def test_config4a_ok
def test_config5_ok
def test_config6_failure
def test_config7_ok
def test_config_8_ok
def test_config_8a_ok
def test_config_9_ok
def test_config_10_ok
def test_config11_ok
def test_config12_failure
def test_config13_failure
def setup_via_listener
def test_listen_config_10_ok
def test_listen_config_1_ok
def setUp
def tearDown
def assert_log_lines
def next_message

Public Attributes

 saved_handlers
 saved_handler_list
 saved_loggers
 saved_level_names
 logger_states
 logger1
 logger2
 root_logger
 original_logging_level
 stream
 root_hdlr
 root_formatter

Static Public Attributes

string expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$"
dictionary config0
dictionary config1
dictionary config1a
dictionary config2
dictionary config2a
dictionary config2b
dictionary config3
dictionary config4
dictionary config4a
dictionary config5
dictionary config6
dictionary config7
dictionary config8
dictionary config8a
dictionary config9
dictionary config9a
dictionary config9b
dictionary config10
dictionary config11
dictionary config12
dictionary config13
string log_format = "%(name)s -> %(levelname)s: %(message)s"
int message_num = 0

Detailed Description

Reading logging config from a dictionary.

Definition at line 1119 of file test_logging.py.


Member Function Documentation

Definition at line 1695 of file test_logging.py.

01695 
01696     def apply_config(self, conf):
01697         logging.config.dictConfig(conf)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_logging.BaseTest.assert_log_lines (   self,
  expected_values,
  stream = None 
) [inherited]
Match the collected log lines against the regular expression
self.expected_log_pat, and compare the extracted group values to
the expected_values list of tuples.

Definition at line 131 of file test_logging.py.

00131 
00132     def assert_log_lines(self, expected_values, stream=None):
00133         """Match the collected log lines against the regular expression
00134         self.expected_log_pat, and compare the extracted group values to
00135         the expected_values list of tuples."""
00136         stream = stream or self.stream
00137         pat = re.compile(self.expected_log_pat)
00138         try:
00139             stream.reset()
00140             actual_lines = stream.readlines()
00141         except AttributeError:
00142             # StringIO.StringIO lacks a reset() method.
00143             actual_lines = stream.getvalue().splitlines()
00144         self.assertEqual(len(actual_lines), len(expected_values),
00145                           '%s vs. %s' % (actual_lines, expected_values))
00146         for actual, expected in zip(actual_lines, expected_values):
00147             match = pat.search(actual)
00148             if not match:
00149                 self.fail("Log line does not match expected pattern:\n" +
00150                             actual)
00151             self.assertEqual(tuple(match.groups()), expected)
00152         s = stream.read()
00153         if s:
00154             self.fail("Remaining output at end of log stream:\n" + s)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_logging.BaseTest.next_message (   self) [inherited]
Generate a message consisting solely of an auto-incrementing
integer.

Definition at line 155 of file test_logging.py.

00155 
00156     def next_message(self):
00157         """Generate a message consisting solely of an auto-incrementing
00158         integer."""
00159         self.message_num += 1
00160         return "%d" % self.message_num
00161 

Here is the caller graph for this function:

def test.test_logging.BaseTest.setUp (   self) [inherited]
Setup the default logging stream to an internal StringIO instance,
so that we can examine log output as we want.

Reimplemented in test.test_logging.BaseFileTest, test.test_logging.QueueHandlerTest, test.test_logging.LogRecordFactoryTest, test.test_logging.MemoryTest, test.test_logging.SocketHandlerTest, test.test_logging.MemoryHandlerTest, and test.test_logging.CustomLevelsAndFiltersTest.

Definition at line 63 of file test_logging.py.

00063 
00064     def setUp(self):
00065         """Setup the default logging stream to an internal StringIO instance,
00066         so that we can examine log output as we want."""
00067         logger_dict = logging.getLogger().manager.loggerDict
00068         logging._acquireLock()
00069         try:
00070             self.saved_handlers = logging._handlers.copy()
00071             self.saved_handler_list = logging._handlerList[:]
00072             self.saved_loggers = saved_loggers = logger_dict.copy()
00073             self.saved_level_names = logging._levelNames.copy()
00074             self.logger_states = logger_states = {}
00075             for name in saved_loggers:
00076                 logger_states[name] = getattr(saved_loggers[name],
00077                                               'disabled', None)
00078         finally:
00079             logging._releaseLock()
00080 
00081         # Set two unused loggers: one non-ASCII and one Unicode.
00082         # This is to test correct operation when sorting existing
00083         # loggers in the configuration code. See issue 8201.
00084         self.logger1 = logging.getLogger("\xab\xd7\xbb")
00085         self.logger2 = logging.getLogger("\u013f\u00d6\u0047")
00086 
00087         self.root_logger = logging.getLogger("")
00088         self.original_logging_level = self.root_logger.getEffectiveLevel()
00089 
00090         self.stream = io.StringIO()
00091         self.root_logger.setLevel(logging.DEBUG)
00092         self.root_hdlr = logging.StreamHandler(self.stream)
00093         self.root_formatter = logging.Formatter(self.log_format)
00094         self.root_hdlr.setFormatter(self.root_formatter)
00095         if self.logger1.hasHandlers():
00096             hlist = self.logger1.handlers + self.root_logger.handlers
00097             raise AssertionError('Unexpected handlers: %s' % hlist)
00098         if self.logger2.hasHandlers():
00099             hlist = self.logger2.handlers + self.root_logger.handlers
00100             raise AssertionError('Unexpected handlers: %s' % hlist)
00101         self.root_logger.addHandler(self.root_hdlr)
00102         self.assertTrue(self.logger1.hasHandlers())
00103         self.assertTrue(self.logger2.hasHandlers())

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1932 of file test_logging.py.

01932 
01933     def setup_via_listener(self, text):
01934         text = text.encode("utf-8")
01935         # Ask for a randomly assigned port (by using port 0)
01936         t = logging.config.listen(0)
01937         t.start()
01938         t.ready.wait()
01939         # Now get the port allocated
01940         port = t.port
01941         t.ready.clear()
01942         try:
01943             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
01944             sock.settimeout(2.0)
01945             sock.connect(('localhost', port))
01946 
01947             slen = struct.pack('>L', len(text))
01948             s = slen + text
01949             sentsofar = 0
01950             left = len(s)
01951             while left > 0:
01952                 sent = sock.send(s[sentsofar:])
01953                 sentsofar += sent
01954                 left -= sent
01955             sock.close()
01956         finally:
01957             t.ready.wait(2.0)
01958             logging.config.stopListening()
01959             t.join(2.0)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_logging.BaseTest.tearDown (   self) [inherited]
Remove our logging stream, and restore the original logging
level.

Reimplemented in test.test_logging.BaseFileTest, test.test_logging.QueueHandlerTest, test.test_logging.LogRecordFactoryTest, test.test_logging.SocketHandlerTest, and test.test_logging.MemoryHandlerTest.

Definition at line 104 of file test_logging.py.

00104 
00105     def tearDown(self):
00106         """Remove our logging stream, and restore the original logging
00107         level."""
00108         self.stream.close()
00109         self.root_logger.removeHandler(self.root_hdlr)
00110         while self.root_logger.handlers:
00111             h = self.root_logger.handlers[0]
00112             self.root_logger.removeHandler(h)
00113             h.close()
00114         self.root_logger.setLevel(self.original_logging_level)
00115         logging._acquireLock()
00116         try:
00117             logging._levelNames.clear()
00118             logging._levelNames.update(self.saved_level_names)
00119             logging._handlers.clear()
00120             logging._handlers.update(self.saved_handlers)
00121             logging._handlerList[:] = self.saved_handler_list
00122             loggerDict = logging.getLogger().manager.loggerDict
00123             loggerDict.clear()
00124             loggerDict.update(self.saved_loggers)
00125             logger_states = self.logger_states
00126             for name in self.logger_states:
00127                 if logger_states[name] is not None:
00128                     self.saved_loggers[name].disabled = logger_states[name]
00129         finally:
00130             logging._releaseLock()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1698 of file test_logging.py.

01698 
01699     def test_config0_ok(self):
01700         # A simple config which overrides the default settings.
01701         with captured_stdout() as output:
01702             self.apply_config(self.config0)
01703             logger = logging.getLogger()
01704             # Won't output anything
01705             logger.info(self.next_message())
01706             # Outputs a message
01707             logger.error(self.next_message())
01708             self.assert_log_lines([
01709                 ('ERROR', '2'),
01710             ], stream=output)
01711             # Original logger output is empty.
01712             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1922 of file test_logging.py.

01922 
01923     def test_config11_ok(self):
01924         self.test_config1_ok(self.config11)

Here is the call graph for this function:

Definition at line 1925 of file test_logging.py.

01925 
01926     def test_config12_failure(self):
01927         self.assertRaises(Exception, self.apply_config, self.config12)

Here is the call graph for this function:

Definition at line 1928 of file test_logging.py.

01928 
01929     def test_config13_failure(self):
01930         self.assertRaises(Exception, self.apply_config, self.config13)

Here is the call graph for this function:

Definition at line 1713 of file test_logging.py.

01713 
01714     def test_config1_ok(self, config=config1):
01715         # A config defining a sub-parser as well.
01716         with captured_stdout() as output:
01717             self.apply_config(config)
01718             logger = logging.getLogger("compiler.parser")
01719             # Both will output a message
01720             logger.info(self.next_message())
01721             logger.error(self.next_message())
01722             self.assert_log_lines([
01723                 ('INFO', '1'),
01724                 ('ERROR', '2'),
01725             ], stream=output)
01726             # Original logger output is empty.
01727             self.assert_log_lines([])

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1728 of file test_logging.py.

01728 
01729     def test_config2_failure(self):
01730         # A simple config which overrides the default settings.
01731         self.assertRaises(Exception, self.apply_config, self.config2)

Here is the call graph for this function:

Definition at line 1732 of file test_logging.py.

01732 
01733     def test_config2a_failure(self):
01734         # A simple config which overrides the default settings.
01735         self.assertRaises(Exception, self.apply_config, self.config2a)

Here is the call graph for this function:

Definition at line 1736 of file test_logging.py.

01736 
01737     def test_config2b_failure(self):
01738         # A simple config which overrides the default settings.
01739         self.assertRaises(Exception, self.apply_config, self.config2b)

Here is the call graph for this function:

Definition at line 1740 of file test_logging.py.

01740 
01741     def test_config3_failure(self):
01742         # A simple config which overrides the default settings.
01743         self.assertRaises(Exception, self.apply_config, self.config3)

Here is the call graph for this function:

Definition at line 1744 of file test_logging.py.

01744 
01745     def test_config4_ok(self):
01746         # A config specifying a custom formatter class.
01747         with captured_stdout() as output:
01748             self.apply_config(self.config4)
01749             #logger = logging.getLogger()
01750             try:
01751                 raise RuntimeError()
01752             except RuntimeError:
01753                 logging.exception("just testing")
01754             sys.stdout.seek(0)
01755             self.assertEqual(output.getvalue(),
01756                 "ERROR:root:just testing\nGot a [RuntimeError]\n")
01757             # Original logger output is empty
01758             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1759 of file test_logging.py.

01759 
01760     def test_config4a_ok(self):
01761         # A config specifying a custom formatter class.
01762         with captured_stdout() as output:
01763             self.apply_config(self.config4a)
01764             #logger = logging.getLogger()
01765             try:
01766                 raise RuntimeError()
01767             except RuntimeError:
01768                 logging.exception("just testing")
01769             sys.stdout.seek(0)
01770             self.assertEqual(output.getvalue(),
01771                 "ERROR:root:just testing\nGot a [RuntimeError]\n")
01772             # Original logger output is empty
01773             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1774 of file test_logging.py.

01774 
01775     def test_config5_ok(self):
01776         self.test_config1_ok(config=self.config5)

Here is the call graph for this function:

Definition at line 1777 of file test_logging.py.

01777 
01778     def test_config6_failure(self):
01779         self.assertRaises(Exception, self.apply_config, self.config6)

Here is the call graph for this function:

Definition at line 1780 of file test_logging.py.

01780 
01781     def test_config7_ok(self):
01782         with captured_stdout() as output:
01783             self.apply_config(self.config1)
01784             logger = logging.getLogger("compiler.parser")
01785             # Both will output a message
01786             logger.info(self.next_message())
01787             logger.error(self.next_message())
01788             self.assert_log_lines([
01789                 ('INFO', '1'),
01790                 ('ERROR', '2'),
01791             ], stream=output)
01792             # Original logger output is empty.
01793             self.assert_log_lines([])
01794         with captured_stdout() as output:
01795             self.apply_config(self.config7)
01796             logger = logging.getLogger("compiler.parser")
01797             self.assertTrue(logger.disabled)
01798             logger = logging.getLogger("compiler.lexer")
01799             # Both will output a message
01800             logger.info(self.next_message())
01801             logger.error(self.next_message())
01802             self.assert_log_lines([
01803                 ('INFO', '3'),
01804                 ('ERROR', '4'),
01805             ], stream=output)
01806             # Original logger output is empty.
01807             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1903 of file test_logging.py.

01903 
01904     def test_config_10_ok(self):
01905         with captured_stdout() as output:
01906             self.apply_config(self.config10)
01907             logger = logging.getLogger("compiler.parser")
01908             logger.warning(self.next_message())
01909             logger = logging.getLogger('compiler')
01910             #Not output, because filtered
01911             logger.warning(self.next_message())
01912             logger = logging.getLogger('compiler.lexer')
01913             #Not output, because filtered
01914             logger.warning(self.next_message())
01915             logger = logging.getLogger("compiler.parser.codegen")
01916             #Output, as not filtered
01917             logger.error(self.next_message())
01918             self.assert_log_lines([
01919                 ('WARNING', '1'),
01920                 ('ERROR', '4'),
01921             ], stream=output)

Here is the call graph for this function:

Definition at line 1809 of file test_logging.py.

01809 
01810     def test_config_8_ok(self):
01811         with captured_stdout() as output:
01812             self.apply_config(self.config1)
01813             logger = logging.getLogger("compiler.parser")
01814             # All will output a message
01815             logger.info(self.next_message())
01816             logger.error(self.next_message())
01817             self.assert_log_lines([
01818                 ('INFO', '1'),
01819                 ('ERROR', '2'),
01820             ], stream=output)
01821             # Original logger output is empty.
01822             self.assert_log_lines([])
01823         with captured_stdout() as output:
01824             self.apply_config(self.config8)
01825             logger = logging.getLogger("compiler.parser")
01826             self.assertFalse(logger.disabled)
01827             # Both will output a message
01828             logger.info(self.next_message())
01829             logger.error(self.next_message())
01830             logger = logging.getLogger("compiler.lexer")
01831             # Both will output a message
01832             logger.info(self.next_message())
01833             logger.error(self.next_message())
01834             self.assert_log_lines([
01835                 ('INFO', '3'),
01836                 ('ERROR', '4'),
01837                 ('INFO', '5'),
01838                 ('ERROR', '6'),
01839             ], stream=output)
01840             # Original logger output is empty.
01841             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1842 of file test_logging.py.

01842 
01843     def test_config_8a_ok(self):
01844         with captured_stdout() as output:
01845             self.apply_config(self.config1a)
01846             logger = logging.getLogger("compiler.parser")
01847             # See issue #11424. compiler-hyphenated sorts
01848             # between compiler and compiler.xyz and this
01849             # was preventing compiler.xyz from being included
01850             # in the child loggers of compiler because of an
01851             # overzealous loop termination condition.
01852             hyphenated = logging.getLogger('compiler-hyphenated')
01853             # All will output a message
01854             logger.info(self.next_message())
01855             logger.error(self.next_message())
01856             hyphenated.critical(self.next_message())
01857             self.assert_log_lines([
01858                 ('INFO', '1'),
01859                 ('ERROR', '2'),
01860                 ('CRITICAL', '3'),
01861             ], stream=output)
01862             # Original logger output is empty.
01863             self.assert_log_lines([])
01864         with captured_stdout() as output:
01865             self.apply_config(self.config8a)
01866             logger = logging.getLogger("compiler.parser")
01867             self.assertFalse(logger.disabled)
01868             # Both will output a message
01869             logger.info(self.next_message())
01870             logger.error(self.next_message())
01871             logger = logging.getLogger("compiler.lexer")
01872             # Both will output a message
01873             logger.info(self.next_message())
01874             logger.error(self.next_message())
01875             # Will not appear
01876             hyphenated.critical(self.next_message())
01877             self.assert_log_lines([
01878                 ('INFO', '4'),
01879                 ('ERROR', '5'),
01880                 ('INFO', '6'),
01881                 ('ERROR', '7'),
01882             ], stream=output)
01883             # Original logger output is empty.
01884             self.assert_log_lines([])

Here is the call graph for this function:

Definition at line 1885 of file test_logging.py.

01885 
01886     def test_config_9_ok(self):
01887         with captured_stdout() as output:
01888             self.apply_config(self.config9)
01889             logger = logging.getLogger("compiler.parser")
01890             #Nothing will be output since both handler and logger are set to WARNING
01891             logger.info(self.next_message())
01892             self.assert_log_lines([], stream=output)
01893             self.apply_config(self.config9a)
01894             #Nothing will be output since both handler is still set to WARNING
01895             logger.info(self.next_message())
01896             self.assert_log_lines([], stream=output)
01897             self.apply_config(self.config9b)
01898             #Message should now be output
01899             logger.info(self.next_message())
01900             self.assert_log_lines([
01901                 ('INFO', '3'),
01902             ], stream=output)

Here is the call graph for this function:

Definition at line 1960 of file test_logging.py.

01960 
01961     def test_listen_config_10_ok(self):
01962         with captured_stdout() as output:
01963             self.setup_via_listener(json.dumps(self.config10))
01964             logger = logging.getLogger("compiler.parser")
01965             logger.warning(self.next_message())
01966             logger = logging.getLogger('compiler')
01967             #Not output, because filtered
01968             logger.warning(self.next_message())
01969             logger = logging.getLogger('compiler.lexer')
01970             #Not output, because filtered
01971             logger.warning(self.next_message())
01972             logger = logging.getLogger("compiler.parser.codegen")
01973             #Output, as not filtered
01974             logger.error(self.next_message())
01975             self.assert_log_lines([
01976                 ('WARNING', '1'),
01977                 ('ERROR', '4'),
01978             ], stream=output)

Here is the call graph for this function:

Definition at line 1979 of file test_logging.py.

01979 
01980     def test_listen_config_1_ok(self):
01981         with captured_stdout() as output:
01982             self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
01983             logger = logging.getLogger("compiler.parser")
01984             # Both will output a message
01985             logger.info(self.next_message())
01986             logger.error(self.next_message())
01987             self.assert_log_lines([
01988                 ('INFO', '1'),
01989                 ('ERROR', '2'),
01990             ], stream=output)
01991             # Original logger output is empty.
01992             self.assert_log_lines([])
01993 

Here is the call graph for this function:


Member Data Documentation

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'root' : {
            'level' : 'WARNING',
            'handlers' : ['hand1'],
        },
    }

Definition at line 1126 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1148 of file test_logging.py.

Definition at line 1570 of file test_logging.py.

Initial value:
{
        'version': 1,
        'true_formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handler_configs': {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'formatters' : 'cfg://true_formatters',
        'handlers' : {
            'hand1' : 'cfg://handler_configs[hand1]',
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1604 of file test_logging.py.

Initial value:
{
        'true_formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handler_configs': {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'formatters' : 'cfg://true_formatters',
        'handlers' : {
            'hand1' : 'cfg://handler_configs[hand1]',
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1635 of file test_logging.py.

Initial value:
{
        'version': 2,
        'true_formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handler_configs': {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'formatters' : 'cfg://true_formatters',
        'handlers' : {
            'hand1' : 'cfg://handler_configs[hand1]',
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1665 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
            },
        },
        'root' : {
            'level' : 'WARNING',
            'handlers' : ['hand1'],
        },
    }

Definition at line 1175 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdbout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1202 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NTOSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1229 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WRANING',
        },
    }

Definition at line 1257 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'misspelled_name',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1284 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                '()' : __name__ + '.ExceptionFormatter',
                'format' : '%(levelname)s:%(name)s:%(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'root' : {
            'level' : 'NOTSET',
                'handlers' : ['hand1'],
        },
    }

Definition at line 1311 of file test_logging.py.

Definition at line 1334 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : __name__ + '.CustomHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1368 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : __name__ + '.CustomHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
                '9' : 'invalid parameter name',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1396 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.lexer' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1425 of file test_logging.py.

Initial value:
{
        'version': 1,
        'disable_existing_loggers' : False,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
            'compiler.lexer' : {
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1454 of file test_logging.py.

Initial value:
{
        'version': 1,
        'disable_existing_loggers' : True,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'NOTSET',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler' : {
                'level' : 'DEBUG',
                'handlers' : ['hand1'],
            },
            'compiler.lexer' : {
            },
        },
        'root' : {
            'level' : 'WARNING',
        },
    }

Definition at line 1484 of file test_logging.py.

Initial value:
{
        'version': 1,
        'formatters': {
            'form1' : {
                'format' : '%(levelname)s ++ %(message)s',
            },
        },
        'handlers' : {
            'hand1' : {
                'class' : 'logging.StreamHandler',
                'formatter' : 'form1',
                'level' : 'WARNING',
                'stream'  : 'ext://sys.stdout',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'WARNING',
                'handlers' : ['hand1'],
            },
        },
        'root' : {
            'level' : 'NOTSET',
        },
    }

Definition at line 1513 of file test_logging.py.

Initial value:
{
        'version': 1,
        'incremental' : True,
        'handlers' : {
            'hand1' : {
                'level' : 'WARNING',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'INFO',
            },
        },
    }

Definition at line 1539 of file test_logging.py.

Initial value:
{
        'version': 1,
        'incremental' : True,
        'handlers' : {
            'hand1' : {
                'level' : 'INFO',
            },
        },
        'loggers' : {
            'compiler.parser' : {
                'level' : 'INFO',
            },
        },
    }

Definition at line 1554 of file test_logging.py.

string test.test_logging.ConfigDictTest.expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$" [static]

Reimplemented from test.test_logging.BaseTest.

Definition at line 1123 of file test_logging.py.

string test.test_logging.BaseTest.log_format = "%(name)s -> %(levelname)s: %(message)s" [static, inherited]

Definition at line 59 of file test_logging.py.

Definition at line 83 of file test_logging.py.

Definition at line 84 of file test_logging.py.

Definition at line 73 of file test_logging.py.

Definition at line 61 of file test_logging.py.

Definition at line 87 of file test_logging.py.

Definition at line 92 of file test_logging.py.

Definition at line 91 of file test_logging.py.

Definition at line 86 of file test_logging.py.

Definition at line 70 of file test_logging.py.

Definition at line 69 of file test_logging.py.

Definition at line 72 of file test_logging.py.

Definition at line 71 of file test_logging.py.

Definition at line 89 of file test_logging.py.


The documentation for this class was generated from the following file: