[pitivi/ges] Reprioritize pipeline, ruler and inhibition debug/info messages



commit 6ffa4026377067eda4bd32905f27ed94b67738f8
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Apr 28 00:47:47 2012 -0400

    Reprioritize pipeline, ruler and inhibition debug/info messages
    
    This avoids spamming the logs when using PITIVI_DEBUG=3,
    and provides a clearer differenciation with debug level 4.

 pitivi/mainwindow.py     |    2 +-
 pitivi/timeline/ruler.py |    4 ++--
 pitivi/utils/system.py   |   19 +++++++++----------
 pitivi/viewer.py         |    4 ++--
 4 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 7ec9fc1..942200e 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -1130,7 +1130,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
         elif message.type == gst.MESSAGE_STATE_CHANGED:
             prev, new, pending = message.parse_state_changed()
             if message.src == self._project_pipeline:
-                self.debug("Pipeline state changed. Prev:%r, new:%r, pending:%r", prev, new, pending)
+                self.info("Pipeline state changed. Prev:%r, new:%r, pending:%r", prev, new, pending)
                 state_really_changed = pending == gst.STATE_VOID_PENDING
                 if state_really_changed:
                     self.viewer.pipelineStateChanged(new)
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index a1acfeb..f326bcd 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -98,7 +98,7 @@ class ScaleRuler(gtk.DrawingArea, Zoomable, Loggable):
 ## timeline position changed method
 
     def timelinePositionChanged(self, value, unused_frame=None):
-        self.debug("value : %r", value)
+        self.log("value : %r", value)
         ppos = max(self.nsToPixel(self.position) - 1, 0)
         self.position = value
         npos = max(self.nsToPixel(self.position) - 1, 0)
@@ -110,7 +110,7 @@ class ScaleRuler(gtk.DrawingArea, Zoomable, Loggable):
 ## gtk.Widget overrides
 
     def do_expose_event(self, event):
-        self.debug("exposing ScaleRuler %s", list(event.area))
+        self.log("exposing ScaleRuler %s", list(event.area))
         x, y, width, height = event.area
         # if (x < self.pixmap_offset) or (x+width > self.pixmap_offset + self.pixmap_allocated_width):
         #     self.debug("exposing outside boundaries !")
diff --git a/pitivi/utils/system.py b/pitivi/utils/system.py
index 97fd5c7..4216fb2 100644
--- a/pitivi/utils/system.py
+++ b/pitivi/utils/system.py
@@ -54,14 +54,14 @@ class System(Signallable, Loggable):
 
         if not key in list_:
             list_.append(key)
-            self.debug("emitting 'update-power-inhibition'")
+            self.log("emitting 'update-power-inhibition'")
             self.emit('update-power-inhibition')
 
     def _uninhibit(self, list_, key):
         if key == None:
             if self._isInhibited(list_):
                 list_ = []
-                self.debug("emitting 'update-power-inhibition'")
+                self.log("emitting 'update-power-inhibition'")
                 self.emit('update-power-inhibition')
         else:
             if not isinstance(key, str):
@@ -69,7 +69,7 @@ class System(Signallable, Loggable):
 
             if key in list_:
                 list_.remove(key)
-                self.debug("emitting 'update-power-inhibition'")
+                self.log("emitting 'update-power-inhibition'")
                 self.emit('update-power-inhibition')
 
     def _listToString(self, list_):
@@ -98,7 +98,7 @@ class System(Signallable, Loggable):
         NOTE: it is safe to call this method with a key that is already
             inhibited
         """
-        self.debug("inhibitScreensaver()")
+        self.info("Inhibiting the screensaver")
         self._inhibit(self._screensaver_keys, key)
 
     def uninhibitScreensaver(self, key):
@@ -107,7 +107,7 @@ class System(Signallable, Loggable):
             inhibiting sleep
         NOTE: it is safe to call this method with a key that is not inhibited.
         """
-        self.debug("uninhibitScreensaver()")
+        self.info("Uninhibiting the screensaver")
         self._uninhibit(self._screensaver_keys, key)
 
     def screensaverIsInhibited(self, key=None):
@@ -129,7 +129,7 @@ class System(Signallable, Loggable):
         NOTE: it is safe to call this method with a key that is already
             inhibited
         """
-        self.debug("inhibitSleep()")
+        self.info("Inhibiting sleep")
         self._inhibit(self._sleep_keys, key)
 
     def uninhibitSleep(self, key):
@@ -138,7 +138,7 @@ class System(Signallable, Loggable):
             inhibiting sleep
         NOTE: it is safe to call this method with a key that is not inhibited.
         """
-        self.debug("uninhibitSleep()")
+        self.info("Uninhibiting sleep")
         self._uninhibit(self._sleep_keys, key)
 
     def sleepIsInhibited(self, key=None):
@@ -164,8 +164,7 @@ class System(Signallable, Loggable):
         @arg message: C{str} the body of the message
         @arg icon: C{gtk.gdk.Pixbuf} icon to be shown with the message
         """
-        self.debug("desktopMessage(): %s, %s" \
-            % title % message)
+        self.debug("desktopMessage(): %s, %s" % title % message)
         pass
 
     def desktopIsMessageable():
@@ -232,7 +231,7 @@ class GnomeSystem(FreedesktopOrgSystem):
         #or we inhibit sleep/powersaving when we are processing data
         #we do things the way we do here because the viewer shows the the output
         #of the render pipeline
-        self.debug("updating power inhibitors")
+        self.log("updating power inhibitors")
         toplevel_id = 0
 
         #inhibit power saving if we are rendering, maybe downloading a video
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index e670352..8f7453f 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -481,12 +481,12 @@ class PitiviViewer(gtk.VBox, Loggable):
         try:
             self.current_time = self.pipeline.query_position(gst.FORMAT_TIME)[0]
             if self.current_time != self.previous_time:
-                self.info("value:%s", gst.TIME_ARGS(self.current_time))
+                self.debug("value:%s", gst.TIME_ARGS(self.current_time))
                 self.timecode_entry.setWidgetValue(self.current_time, False)
                 self.seeker.setPosition(self.current_time)
                 self.previous_time = self.current_time
         except:
-            self.debug("Could not check timeline position for the viewer")
+            self.info("Could not check timeline position for the viewer")
 
     def _positionCheckTimerCb(self):
         """



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