[pitivi: 9/10] log: make Loggable.error print the correct line number



commit c77274acddf4cf8da26b9d5025dc3e39e334fcc9
Author: Alessandro Decina <alessandro d gmail com>
Date:   Fri Sep 24 16:49:57 2010 +0200

    log: make Loggable.error print the correct line number

 pitivi/log/loggable.py |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/log/loggable.py b/pitivi/log/loggable.py
index d3b73be..6dde3f2 100644
--- a/pitivi/log/loggable.py
+++ b/pitivi/log/loggable.py
@@ -22,13 +22,6 @@
 from pitivi.log.log import _canShortcutLogging, doLog, ERROR
 from pitivi.log import log
 
-def _errorObject(object, cat, format, *args):
-    """
-    Log a fatal error message in the given category.
-    This will also raise a L{SystemExit}.
-    """
-    doLog(ERROR, object, cat, format, args)
-
 class Loggable(log.Loggable):
     def __init__(self):
         if not hasattr(self, 'logCategory'):
@@ -40,8 +33,8 @@ class Loggable(log.Loggable):
             return "<%s at 0x%x>" % (self.__class__.__name__, id(self))
         return res
 
-    def error(self, *args):
+    def error(self, format, *args):
         if _canShortcutLogging(self.logCategory, ERROR):
             return
-        _errorObject(self.logObjectName(), self.logCategory,
-            *self.logFunction(*args))
+        doLog(ERROR, self.logObjectName(), self.logCategory,
+            format, self.logFunction(*args), where=-2)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]