[Zope-Checkins] CVS: Packages/ZConfig - datatypes.py:1.7

Fred L. Drake, Jr. fred@zope.com
Thu, 16 Jan 2003 10:41:28 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv7235

Modified Files:
	datatypes.py 
Log Message:
Remove the logging-level datatype; support is now provided by the logging
component provided with zLOG.


=== Packages/ZConfig/datatypes.py 1.6 => 1.7 ===
--- Packages/ZConfig/datatypes.py:1.6	Wed Jan 15 10:02:18 2003
+++ Packages/ZConfig/datatypes.py	Thu Jan 16 10:40:55 2003
@@ -103,32 +103,6 @@
         RegularExpressionConversion.__init__(self, "[_a-zA-Z][_a-zA-Z0-9]*")
 
 
-class LogLevelConversion:
-    # This uses the 'logging' package conventions; only makes sense
-    # for Zope 2.7 (and newer) and Zope 3.  Not sure what the
-    # compatibility should be.
-
-    _levels = {
-        "critical": 50,
-        "fatal": 50,
-        "error": 40,
-        "warn": 30,
-        "info": 20,
-        "debug": 10,
-        "all": 0,
-        }
-
-    def __call__(self, value):
-        s = str(value).lower()
-        if self._levels.has_key(s):
-            return self._levels[s]
-        else:
-            v = int(s)
-            if v < 0 or v > 50:
-                raise ValueError("log level not in range: " + `v`)
-            return v
-
-
 if sys.version[:3] < "2.3":
     def integer(value):
         try:
@@ -311,7 +285,6 @@
     "locale":            MemoizedConversion(check_locale),
     "port-number":       port_number,
     "basic-key":         BasicKeyConversion(),
-    "logging-level":     LogLevelConversion(),
     "inet-address":      inet_address,
     "socket-address":    SocketAddress,
     "ipaddr-or-hostname":IpaddrOrHostname(),