diff options
author | Stefan Kost <ensonic@users.sf.net> | 2010-07-06 11:42:08 +0300 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2011-11-05 22:50:12 +0100 |
commit | 3e27cb4e0abde5433a212d47e9b44daf750e24dc (patch) | |
tree | 562c711c54e14c618763f694e64ed3f6c7936edb | |
parent | c79915cb1ba7e30ac3f19c40dedb9b226d04acf8 (diff) |
Add 'fixme' and 'trace' log levels
-rw-r--r-- | GstDebugViewer/Data.py | 15 | ||||
-rw-r--r-- | GstDebugViewer/GUI/colors.py | 4 | ||||
-rw-r--r-- | GstDebugViewer/Plugins/Timeline.py | 21 |
3 files changed, 31 insertions, 9 deletions
diff --git a/GstDebugViewer/Data.py b/GstDebugViewer/Data.py index 1752382..077aec0 100644 --- a/GstDebugViewer/Data.py +++ b/GstDebugViewer/Data.py @@ -69,7 +69,7 @@ def parse_time (st): class DebugLevel (int): - __names = ["NONE", "ERROR", "WARN", "INFO", "DEBUG", "LOG"] + __names = ["NONE", "ERROR", "WARN", "INFO", "DEBUG", "LOG", "FIXME", "TRACE"] __instances = {} def __new__ (cls, level): @@ -113,7 +113,11 @@ debug_level_warning = DebugLevel ("WARN") debug_level_info = DebugLevel ("INFO") debug_level_debug = DebugLevel ("DEBUG") debug_level_log = DebugLevel ("LOG") +debug_level_fixme = DebugLevel ("FIXME") +debug_level_trace = DebugLevel ("TRACE") debug_levels = [debug_level_none, + debug_level_trace, + debug_level_fixme, debug_level_log, debug_level_debug, debug_level_info, @@ -213,10 +217,11 @@ class LineCache (Producer): offsets = self.offsets levels = self.levels - dict_levels = {"D" : debug_level_debug, "L" : debug_level_log, - "I" : debug_level_info, "E" : debug_level_error, - "W" : debug_level_warning, " " : debug_level_none} - rexp = re.compile (r"\d:\d\d:\d\d\.\d+\s+\d+\s+0x[0-9a-f]+\s+([DLIEW ])") + dict_levels = {"T" : debug_level_trace, "F" : debug_level_fixme, + "L" : debug_level_log, "D" : debug_level_debug, + "I" : debug_level_info, "W" : debug_level_warning, + "E" : debug_level_error, " " : debug_level_none} + rexp = re.compile (r"\d:\d\d:\d\d\.\d+\s+\d+\s+0x[0-9a-f]+\s+([TFLDIEW ])") # Moving attribute lookups out of the loop: readline = self.__fileobj.readline diff --git a/GstDebugViewer/GUI/colors.py b/GstDebugViewer/GUI/colors.py index 6e84093..fc5cb04 100644 --- a/GstDebugViewer/GUI/colors.py +++ b/GstDebugViewer/GUI/colors.py @@ -123,6 +123,10 @@ class LevelColorThemeTango (LevelColorTheme): p = TangoPalette.get () self.add_color (Data.debug_level_none, None, None, None) + self.add_color (Data.debug_level_trace, + p.black, p.aluminium2, Color ("#d3d7cf")) + self.add_color (Data.debug_level_fixme, + p.black, p.butter3, Color ("#c4a000")) self.add_color (Data.debug_level_log, p.black, p.plum1, Color ("#e0a4d9")) self.add_color (Data.debug_level_debug, diff --git a/GstDebugViewer/Plugins/Timeline.py b/GstDebugViewer/Plugins/Timeline.py index b05cddc..37ffaee 100644 --- a/GstDebugViewer/Plugins/Timeline.py +++ b/GstDebugViewer/Plugins/Timeline.py @@ -152,6 +152,7 @@ class LevelDistributionSentinel (object): def process (self): + MAX_LEVELS = 8 YIELD_LIMIT = 10000 y = YIELD_LIMIT @@ -164,7 +165,7 @@ class LevelDistributionSentinel (object): i = 0 partitions_i = 0 partitions = self.freq_sentinel.partitions - counts = [0] * 6 + counts = [0] * MAX_LEVELS tree_iter = self.model.get_iter_first () if not partitions: @@ -179,7 +180,7 @@ class LevelDistributionSentinel (object): level = model_get (tree_iter, id_level) while i > partitions[partitions_i]: data.append (tuple (counts)) - counts = [0] * 6 + counts = [0] * MAX_LEVELS partitions_i += 1 if partitions_i == len (partitions): finished = True @@ -608,18 +609,30 @@ class TimelineWidget (gtk.DrawingArea): yield sum ((level_counts[level] for level in levels)) level = Data.debug_level_info - levels_prev = (Data.debug_level_log, Data.debug_level_debug,) + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,Data.debug_level_log, Data.debug_level_debug,) ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, list (cumulative_level_counts (level, *levels_prev))) level = Data.debug_level_debug - levels_prev = (Data.debug_level_log,) + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,Data.debug_level_log,) ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, list (cumulative_level_counts (level, *levels_prev))) level = Data.debug_level_log + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,) + ctx.set_source_rgb (*(colors[level][1].float_tuple ())) + self.__draw_graph (ctx, w, h, maximum, + list (cumulative_level_counts (level, *levels_prev))) + + level = Data.debug_level_fixme + levels_prev = (Data.debug_level_trace,) + ctx.set_source_rgb (*(colors[level][1].float_tuple ())) + self.__draw_graph (ctx, w, h, maximum, + list (cumulative_level_counts (level, *levels_prev))) + + level = Data.debug_level_trace ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, [counts[level] for counts in dist_data]) |