finally:
_releaseLock()
+def _checkLevel(level):
+ if isinstance(level, int):
+ rv = level
+ elif str(level) == level:
+ if level not in _levelNames:
+ raise ValueError("Unknown level: %r" % level)
+ rv = _levelNames[level]
+ else:
+ raise TypeError("Level not an integer or a valid string: %r" % level)
+ return rv
+
#---------------------------------------------------------------------------
# Thread-related stuff
#---------------------------------------------------------------------------
and the filter list to empty.
"""
Filterer.__init__(self)
- self.level = level
+ self.level = _checkLevel(level)
self.formatter = None
#get the module data lock, as we're updating a shared structure.
_acquireLock()
"""
Set the logging level of this handler.
"""
- self.level = level
+ self.level = _checkLevel(level)
def format(self, record):
"""
"""
Filterer.__init__(self)
self.name = name
- self.level = level
+ self.level = _checkLevel(level)
self.parent = None
self.propagate = 1
self.handlers = []
"""
Set the logging level of this logger.
"""
- self.level = level
+ self.level = _checkLevel(level)
def debug(self, msg, *args, **kwargs):
"""
root.addHandler(hdlr)
level = kwargs.get("level")
if level is not None:
- if str(level) == level: # If a string was passed, do more checks
- if level not in _levelNames:
- raise ValueError("Unknown level: %r" % level)
- level = _levelNames[level]
root.setLevel(level)
#---------------------------------------------------------------------------
Library
-------
-- Issue #6314: logging.basicConfig() performs extra checks on the "level"
- argument.
+- Issue #6314: logging: performs extra checks on the "level" argument.
- Issue #6274: Fixed possible file descriptors leak in subprocess.py
-------
- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
- expression string pattern was trying to match against a bytes returned by
+ expression string pattern was trying to match against a bytes returned by
Popen. Tested under win32 to build the py-postgresql project.
- Issue #6258: Support AMD64 in bdist_msi.
Library
-------
-- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
- "PyInit" prefix, rather than "init".
+- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
+ "PyInit" prefix, rather than "init".
-- Issue #6455: Fixed test_build_ext under win32.
+- Issue #6455: Fixed test_build_ext under win32.
-- Issue #6377: Enabled the compiler option, and deprecate its usage as an
+- Issue #6377: Enabled the compiler option, and deprecate its usage as an
attribute.
- Issue #6413: Fixed the log level in distutils.dist for announce.
- Issue #6403: Fixed package path usage in build_ext.
-- Issue #6365: Distutils build_ext inplace mode was copying the compiled
+- Issue #6365: Distutils build_ext inplace mode was copying the compiled
extension in a subdirectory if the extension name had dots.
-- Issue #6164: Added an AIX specific linker argument in Distutils
+- Issue #6164: Added an AIX specific linker argument in Distutils
unixcompiler. Original patch by Sridhar Ratnakumar.
- Issue #6286: Now Distutils upload command is based on urllib2 instead of