Don't use .warn on loggers, use .warning instead.

This commit is contained in:
Florian Bruhin 2014-06-22 23:30:44 +02:00
parent cee0dea9c4
commit bf9e829d4d
4 changed files with 13 additions and 13 deletions

View File

@ -243,7 +243,7 @@ class Application(QApplication):
try: try:
os.remove(logname) os.remove(logname)
except PermissionError: except PermissionError:
log.init.warn("Could not remove crash log!") log.init.warning("Could not remove crash log!")
else: else:
self._init_crashlogfile() self._init_crashlogfile()
self._crashdlg = FatalCrashDialog(data) self._crashdlg = FatalCrashDialog(data)
@ -253,11 +253,11 @@ class Application(QApplication):
# This means another instance is probably still running and # This means another instance is probably still running and
# didn't remove the file. As we can't write to the same file, # didn't remove the file. As we can't write to the same file,
# we just leave faulthandler as it is and log to stderr. # we just leave faulthandler as it is and log to stderr.
log.init.warn("Empty crash log detected. This means either " log.init.warning("Empty crash log detected. This means either "
"another instance is running (then ignore this " "another instance is running (then ignore "
"warning) or the file is lying here because " "this warning) or the file is lying here "
"of some earlier crash (then delete {}).".format( "because of some earlier crash (then delete "
logname)) "{}).".format(logname))
self._crashlogfile = None self._crashlogfile = None
else: else:
# There's no log file, so we can use this to display crashes to the # There's no log file, so we can use this to display crashes to the
@ -472,7 +472,7 @@ class Application(QApplication):
try: try:
os.remove(self._crashlogfile.name) os.remove(self._crashlogfile.name)
except PermissionError as e: except PermissionError as e:
log.destroy.warn("Could not remove crash log ({})!".format(e)) log.destroy.warning("Could not remove crash log ({})!".format(e))
def _exception_hook(self, exctype, excvalue, tb): def _exception_hook(self, exctype, excvalue, tb):
"""Handle uncaught python exceptions. """Handle uncaught python exceptions.

View File

@ -74,7 +74,7 @@ class SignalFilter(QObject):
log_signal = not signal.signal.startswith('2cur_progress') log_signal = not signal.signal.startswith('2cur_progress')
if not isinstance(sender, WebView): if not isinstance(sender, WebView):
# BUG? This should never happen, but it does regularely... # BUG? This should never happen, but it does regularely...
logger.warn("Got signal {} by {} which is no tab!".format( logger.warning("Got signal {} by {} which is no tab!".format(
dbg_signal(signal, args), sender)) dbg_signal(signal, args), sender))
return return
if self._tabs.currentWidget() == sender: if self._tabs.currentWidget() == sender:

View File

@ -127,7 +127,7 @@ def _release_info():
with open(fn, 'r') as f: with open(fn, 'r') as f:
data.append((fn, ''.join(f.readlines()))) data.append((fn, ''.join(f.readlines())))
except IOError as e: except IOError as e:
logger.warn("Error while reading {}: {}: {}".format( logger.warning("Error while reading {}: {}: {}".format(
fn, e.__class__.__name__, e)) fn, e.__class__.__name__, e))
return data return data
@ -149,7 +149,7 @@ def _module_versions():
lines.append('SIP: {}'.format( lines.append('SIP: {}'.format(
sipconfig.Configuration().sip_version_str)) sipconfig.Configuration().sip_version_str))
except (AttributeError, TypeError) as e: except (AttributeError, TypeError) as e:
logger.warn("Error while getting SIP version: {}: {}".format( logger.warning("Error while getting SIP version: {}: {}".format(
e.__class__.__name__, e)) e.__class__.__name__, e))
lines.append('SIP: ?') lines.append('SIP: ?')

View File

@ -60,18 +60,18 @@ class MainWindow(QWidget):
geom = b64decode(stateconf['geometry']['mainwindow'], geom = b64decode(stateconf['geometry']['mainwindow'],
validate=True) validate=True)
except (KeyError, binascii.Error) as e: except (KeyError, binascii.Error) as e:
logger.warn("Error while reading geometry: {}: {}".format( logger.warning("Error while reading geometry: {}: {}".format(
e.__class__.__name__, e)) e.__class__.__name__, e))
self._set_default_geometry() self._set_default_geometry()
else: else:
try: try:
ok = self.restoreGeometry(geom) ok = self.restoreGeometry(geom)
except KeyError: except KeyError:
logger.warn("Error while restoring geometry: {}: {}".format( logger.warning("Error while restoring geometry: {}: {}".format(
e.__class__.__name__, e)) e.__class__.__name__, e))
self._set_default_geometry() self._set_default_geometry()
if not ok: if not ok:
logger.warn("Error while restoring geometry.") logger.warning("Error while restoring geometry.")
self._set_default_geometry() self._set_default_geometry()
self._vbox = QVBoxLayout(self) self._vbox = QVBoxLayout(self)