mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 06:28:26 +08:00
Merge pull request #1129 from stefanv/log_leftovers
Remove leftovers of old logger
This commit is contained in:
@@ -120,53 +120,4 @@ doctest.__doc__ = doctest.__doc__
|
||||
doctest_verbose = _functools.partial(test, doctest=True, verbose=True)
|
||||
doctest_verbose.__doc__ = doctest.__doc__
|
||||
|
||||
|
||||
class _Log(Warning):
|
||||
pass
|
||||
|
||||
|
||||
class _FakeLog(object):
|
||||
def __init__(self, name):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
Name of the log.
|
||||
repeat : bool
|
||||
Whether to print repeating messages more than once (False by
|
||||
default).
|
||||
"""
|
||||
self._name = name
|
||||
|
||||
warnings.simplefilter("always", _Log)
|
||||
|
||||
self._warnings = _warnings
|
||||
|
||||
def _warn(self, msg, wtype):
|
||||
self._warnings.warn('%s: %s' % (wtype, msg), _Log)
|
||||
|
||||
def debug(self, msg):
|
||||
self._warn(msg, 'DEBUG')
|
||||
|
||||
def info(self, msg):
|
||||
self._warn(msg, 'INFO')
|
||||
|
||||
def warning(self, msg):
|
||||
self._warn(msg, 'WARNING')
|
||||
|
||||
warn = warning
|
||||
|
||||
def error(self, msg):
|
||||
self._warn(msg, 'ERROR')
|
||||
|
||||
def critical(self, msg):
|
||||
self._warn(msg, 'CRITICAL')
|
||||
|
||||
def addHandler(*args):
|
||||
pass
|
||||
|
||||
def setLevel(*args):
|
||||
pass
|
||||
|
||||
|
||||
from .util.dtype import *
|
||||
|
||||
Reference in New Issue
Block a user