Undo the apply() removals; this code needs to run under Python 1.5.2.

This commit is contained in:
Guido van Rossum 2003-03-02 20:47:29 +00:00
parent 206b9a779a
commit 0df6442ae5
2 changed files with 14 additions and 14 deletions

View File

@ -874,7 +874,7 @@ class Logger(Filterer):
if self.manager.disable >= DEBUG: if self.manager.disable >= DEBUG:
return return
if DEBUG >= self.getEffectiveLevel(): if DEBUG >= self.getEffectiveLevel():
self._log(DEBUG, msg, args, **kwargs) apply(self._log, (DEBUG, msg, args), kwargs)
def info(self, msg, *args, **kwargs): def info(self, msg, *args, **kwargs):
""" """
@ -888,7 +888,7 @@ class Logger(Filterer):
if self.manager.disable >= INFO: if self.manager.disable >= INFO:
return return
if INFO >= self.getEffectiveLevel(): if INFO >= self.getEffectiveLevel():
self._log(INFO, msg, args, **kwargs) apply(self._log, (INFO, msg, args), kwargs)
def warning(self, msg, *args, **kwargs): def warning(self, msg, *args, **kwargs):
""" """
@ -902,7 +902,7 @@ class Logger(Filterer):
if self.manager.disable >= WARNING: if self.manager.disable >= WARNING:
return return
if self.isEnabledFor(WARNING): if self.isEnabledFor(WARNING):
self._log(WARNING, msg, args, **kwargs) apply(self._log, (WARNING, msg, args), kwargs)
warn = warning warn = warning
@ -918,13 +918,13 @@ class Logger(Filterer):
if self.manager.disable >= ERROR: if self.manager.disable >= ERROR:
return return
if self.isEnabledFor(ERROR): if self.isEnabledFor(ERROR):
self._log(ERROR, msg, args, **kwargs) apply(self._log, (ERROR, msg, args), kwargs)
def exception(self, msg, *args): def exception(self, msg, *args):
""" """
Convenience method for logging an ERROR with exception information. Convenience method for logging an ERROR with exception information.
""" """
self.error(msg, exc_info=1, *args) apply(self.error, (msg,) + args, {'exc_info': 1})
def critical(self, msg, *args, **kwargs): def critical(self, msg, *args, **kwargs):
""" """
@ -938,7 +938,7 @@ class Logger(Filterer):
if self.manager.disable >= CRITICAL: if self.manager.disable >= CRITICAL:
return return
if CRITICAL >= self.getEffectiveLevel(): if CRITICAL >= self.getEffectiveLevel():
self._log(CRITICAL, msg, args, **kwargs) apply(self._log, (CRITICAL, msg, args), kwargs)
fatal = critical fatal = critical
@ -954,7 +954,7 @@ class Logger(Filterer):
if self.manager.disable >= level: if self.manager.disable >= level:
return return
if self.isEnabledFor(level): if self.isEnabledFor(level):
self._log(level, msg, args, **kwargs) apply(self._log, (level, msg, args), kwargs)
def findCaller(self): def findCaller(self):
""" """
@ -1131,7 +1131,7 @@ def critical(msg, *args, **kwargs):
""" """
if len(root.handlers) == 0: if len(root.handlers) == 0:
basicConfig() basicConfig()
root.critical(msg, *args, **kwargs) apply(root.critical, (msg,)+args, kwargs)
fatal = critical fatal = critical
@ -1141,14 +1141,14 @@ def error(msg, *args, **kwargs):
""" """
if len(root.handlers) == 0: if len(root.handlers) == 0:
basicConfig() basicConfig()
root.error(msg, *args, **kwargs) apply(root.error, (msg,)+args, kwargs)
def exception(msg, *args): def exception(msg, *args):
""" """
Log a message with severity 'ERROR' on the root logger, Log a message with severity 'ERROR' on the root logger,
with exception information. with exception information.
""" """
error(msg, exc_info=1, *args) apply(error, (msg,)+args, {'exc_info': 1})
def warning(msg, *args, **kwargs): def warning(msg, *args, **kwargs):
""" """
@ -1156,7 +1156,7 @@ def warning(msg, *args, **kwargs):
""" """
if len(root.handlers) == 0: if len(root.handlers) == 0:
basicConfig() basicConfig()
root.warning(msg, *args, **kwargs) apply(root.warning, (msg,)+args, kwargs)
warn = warning warn = warning
@ -1166,7 +1166,7 @@ def info(msg, *args, **kwargs):
""" """
if len(root.handlers) == 0: if len(root.handlers) == 0:
basicConfig() basicConfig()
root.info(msg, *args, **kwargs) apply(root.info, (msg,)+args, kwargs)
def debug(msg, *args, **kwargs): def debug(msg, *args, **kwargs):
""" """
@ -1174,7 +1174,7 @@ def debug(msg, *args, **kwargs):
""" """
if len(root.handlers) == 0: if len(root.handlers) == 0:
basicConfig() basicConfig()
root.debug(msg, *args, **kwargs) apply(root.debug, (msg,)+args, kwargs)
def disable(level): def disable(level):
""" """

View File

@ -102,7 +102,7 @@ def fileConfig(fname, defaults=None):
klass = eval(klass, vars(logging)) klass = eval(klass, vars(logging))
args = cp.get(sectname, "args") args = cp.get(sectname, "args")
args = eval(args, vars(logging)) args = eval(args, vars(logging))
h = klass(*args) h = apply(klass, args)
if "level" in opts: if "level" in opts:
level = cp.get(sectname, "level") level = cp.get(sectname, "level")
h.setLevel(logging._levelNames[level]) h.setLevel(logging._levelNames[level])