summary refs log tree commit diff stats
path: root/ranger/ext/vcs
diff options
context:
space:
mode:
authorael-code <tommy.ael@gmail.com>2016-11-25 15:24:43 +0100
committerael-code <tommy.ael@gmail.com>2016-11-25 17:37:27 +0100
commit1ba63d936ce46582de2571de4b627cc0312280f4 (patch)
treeaf2cb3061cdd7ef34f51f47abcbce653753de21f /ranger/ext/vcs
parent3c8086ece60c839eaaac868678415a5e85eb13db (diff)
downloadranger-1ba63d936ce46582de2571de4b627cc0312280f4.tar.gz
Update all the log calls
All the log calls that were using the old logging approach
(appending to FileManager.log queue) will now use the standard logging
library of python. Proper log levels have been choosed for each call
Diffstat (limited to 'ranger/ext/vcs')
-rw-r--r--ranger/ext/vcs/vcs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index cfdc1e3b..9c2a8b5a 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -7,6 +7,7 @@ import os
 import subprocess
 import threading
 import time
+from logging import getLogger
 from ranger.ext.spawn import spawn
 
 # Python2 compatibility
@@ -19,6 +20,7 @@ try:
 except NameError:
     FileNotFoundError = OSError  # pylint: disable=redefined-builtin
 
+log = getLogger(__name__)
 
 class VcsError(Exception):
     """VCS exception"""
@@ -470,9 +472,8 @@ 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:  # pylint: disable=broad-except
-                import traceback
-                self.ui.fm.log.extendleft(reversed(traceback.format_exc().splitlines()))
+            except Exception as e:  # pylint: disable=broad-except
+                log.exception(e)
                 self.ui.fm.notify('VCS Exception', bad=True)
 
     def pause(self):