diff options
author | nfnty <git@nfnty.se> | 2016-12-21 05:06:16 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-12-21 05:06:16 +0100 |
commit | 0288db49cfe0c94942e6d78ea775e837af2f3c19 (patch) | |
tree | 4190349d83325fbbd5a6ad39bc4f30d7f723bb53 | |
parent | 496b1c00949c0890ea757959d6fd4f84b3f3f200 (diff) | |
download | ranger-0288db49cfe0c94942e6d78ea775e837af2f3c19.tar.gz |
ext.vcs: Improve logging
-rw-r--r-- | ranger/ext/vcs/vcs.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index 9c2a8b5a..8a0b6535 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -20,7 +20,9 @@ try: except NameError: FileNotFoundError = OSError # pylint: disable=redefined-builtin -log = getLogger(__name__) + +LOG = getLogger(__name__) + class VcsError(Exception): """VCS exception""" @@ -236,7 +238,9 @@ class VcsRoot(Vcs): # pylint: disable=abstract-method self.branch = self.data_branch() self.obj.vcsremotestatus = self.data_status_remote() self.obj.vcsstatus = self.data_status_root() - except VcsError: + except VcsError as error: + LOG.exception(error) + self.obj.fm.notify('VCS Exception: View log for more info', bad=True) return False self.rootinit = True return True @@ -249,7 +253,9 @@ class VcsRoot(Vcs): # pylint: disable=abstract-method self.status_subpaths = self.data_status_subpaths() self.obj.vcsremotestatus = self.data_status_remote() self.obj.vcsstatus = self._status_root() - except VcsError: + except VcsError as error: + LOG.exception(error) + self.obj.fm.notify('VCS Exception: View log for more info', bad=True) return False self.rootinit = True self.updatetime = time.time() @@ -472,9 +478,9 @@ class VcsThread(threading.Thread): # pylint: disable=too-many-instance-attribut column.need_redraw = True self.ui.status.need_redraw = True self.ui.redraw() - except Exception as e: # pylint: disable=broad-except - log.exception(e) - self.ui.fm.notify('VCS Exception', bad=True) + except Exception as error: # pylint: disable=broad-except + LOG.exception(error) + self.ui.fm.notify('VCS Exception: View log for more info', bad=True) def pause(self): """Pause thread""" |