mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
Data: add support for colored log files
Adds a ~5% penalty for loading stripped files.
This commit is contained in:
parent
409ae7e522
commit
9474886d85
1 changed files with 12 additions and 5 deletions
|
@ -144,18 +144,21 @@ def default_log_line_regex_ ():
|
||||||
TIME = r"(\d+:\d\d:\d\d\.\d+)\s+"
|
TIME = r"(\d+:\d\d:\d\d\.\d+)\s+"
|
||||||
CATEGORY = "([A-Za-z0-9_-]+)\s+" # "GST_REFCOUNTING ", "flacdec "
|
CATEGORY = "([A-Za-z0-9_-]+)\s+" # "GST_REFCOUNTING ", "flacdec "
|
||||||
# " 3089 "
|
# " 3089 "
|
||||||
PID = r"(\d+)\s+"
|
PID = r"(\d+)\s*"
|
||||||
FILENAME = r"([^:]*):"
|
FILENAME = r"([^:]*):"
|
||||||
LINE = r"(\d+):"
|
LINE = r"(\d+):"
|
||||||
FUNCTION = "([A-Za-z0-9_]*):"
|
FUNCTION = "([A-Za-z0-9_]*):"
|
||||||
# FIXME: When non-g(st)object stuff is logged with *_OBJECT (like
|
# FIXME: When non-g(st)object stuff is logged with *_OBJECT (like
|
||||||
# buffers!), the address is printed *without* <> brackets!
|
# buffers!), the address is printed *without* <> brackets!
|
||||||
OBJECT = "(?:<([^>]+)> )?"
|
OBJECT = "(?:<([^>]+)>)?"
|
||||||
MESSAGE = "(.+)"
|
MESSAGE = "(.+)"
|
||||||
|
|
||||||
|
ANSI = "(?:\x1b\\[[0-9;]*m\\s*)*\\s*"
|
||||||
|
|
||||||
# New log format:
|
# New log format:
|
||||||
expressions = [TIME, PID, THREAD, LEVEL, CATEGORY, FILENAME, LINE, FUNCTION,
|
expressions = [TIME, ANSI, PID, ANSI, THREAD, ANSI, LEVEL, ANSI,
|
||||||
OBJECT, MESSAGE]
|
CATEGORY, FILENAME, LINE, FUNCTION, ANSI,
|
||||||
|
OBJECT, ANSI, MESSAGE]
|
||||||
# Old log format:
|
# Old log format:
|
||||||
## expressions = [LEVEL, THREAD, TIME, CATEGORY, PID, FILENAME, LINE,
|
## expressions = [LEVEL, THREAD, TIME, CATEGORY, PID, FILENAME, LINE,
|
||||||
## FUNCTION, OBJECT, MESSAGE]
|
## FUNCTION, OBJECT, MESSAGE]
|
||||||
|
@ -290,7 +293,11 @@ class LineCache (Producer):
|
||||||
"L" : debug_level_log, "D" : debug_level_debug,
|
"L" : debug_level_log, "D" : debug_level_debug,
|
||||||
"I" : debug_level_info, "W" : debug_level_warning,
|
"I" : debug_level_info, "W" : debug_level_warning,
|
||||||
"E" : debug_level_error, " " : debug_level_none}
|
"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 ])")
|
ANSI = "(?:\x1b\\[[0-9;]*m)?"
|
||||||
|
rexp = re.compile (r"\d:\d\d:\d\d\.\d+ " + ANSI +
|
||||||
|
r" *\d+" + ANSI +
|
||||||
|
r" +0x[0-9a-f]+ +" + ANSI +
|
||||||
|
r"([TFLDIEW ])")
|
||||||
|
|
||||||
# Moving attribute lookups out of the loop:
|
# Moving attribute lookups out of the loop:
|
||||||
readline = self.__fileobj.readline
|
readline = self.__fileobj.readline
|
||||||
|
|
Loading…
Reference in a new issue