[Zodb-checkins] CVS: ZODB3/zLOG/tests - testzLogConfig.py:1.8

Guido van Rossum guido@python.org
Thu, 23 Jan 2003 14:58:41 -0500


Update of /cvs-repository/ZODB3/zLOG/tests
In directory cvs.zope.org:/tmp/cvs-serv4347/zLOG/tests

Modified Files:
	testzLogConfig.py 
Log Message:
Several changes to the zLOG/logging/ZConfig connection:

(1) Change the mapping from zLOG levels to logging levels to use
    custom intermediary levels 15 and 5 for BLATHER and TRACE, rather
    than using a confusing skewed mapping.

(2) In the ZConfig datatype definition for a logging level, added
    'blather' and 'trace' to the level names, added 'warning' as an
    alias for 'warn', change 'all' to mean 1, and add 'notset' to mean
    0.  The semantics of NOTSET are very different than those of 1;
    setting a logger's level to NOTSET searches for a parent logger
    with a nonzero level.  The root of all loggers is initialized with
    WARN as its level, so setting the level to NOTSET effectively sets
    it to WARN rather than to the most inclusive level!

(3) In the schema, change the default level for handlers to notset, so
    they use their logger's level; the default level for the logger is
    set to info, corresponding to the old default for
    STUPID_LOG_SEVERITY.



=== ZODB3/zLOG/tests/testzLogConfig.py 1.7 => 1.8 ===
--- ZODB3/zLOG/tests/testzLogConfig.py:1.7	Thu Jan 23 14:24:18 2003
+++ ZODB3/zLOG/tests/testzLogConfig.py	Thu Jan 23 14:58:38 2003
@@ -172,7 +172,7 @@
         # XXX The "url" attribute of the handler is misnamed; it
         # really means just the selector portion of the URL.
         self.assertEqual(handler.url, "/log/")
-        self.assertEqual(handler.level, logging.INFO)
+        self.assertEqual(handler.level, logging.NOTSET)
         self.assertEqual(handler.method, "GET")
         self.assert_(isinstance(handler, zLOG.LogHandlers.HTTPHandler))
 
@@ -191,7 +191,7 @@
         self.assertEqual(handler.fromaddr, "zlog-user@example.com")
         self.assertEqual(handler.level, logging.FATAL)
 
-    def check_simple_logger(self, text, level=logging.NOTSET):
+    def check_simple_logger(self, text, level=logging.INFO):
         conf = self.get_config(text)
         self.assert_(conf.eventlog is not None)
         self.assertEqual(conf.eventlog.level, level)