mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
Data: remove log line serialization
This is incomplete and prone to error. Move it out into the utility script (which is the only user).
This commit is contained in:
parent
836d10bc58
commit
dab5357986
2 changed files with 14 additions and 16 deletions
|
@ -287,20 +287,6 @@ class LogLine (list):
|
|||
|
||||
return line
|
||||
|
||||
def line_string (self, message = None):
|
||||
|
||||
# Replicates gstreamer/gst/gstinfo.c:gst_debug_log_default.
|
||||
|
||||
ts, pid, thread, level, category, filename, line, function, object_, message_offset = self
|
||||
|
||||
if isinstance (message_offset, str):
|
||||
message = message_offset
|
||||
|
||||
# FIXME: Regarding object_, this doesn't fully replicate the formatting!
|
||||
return "%s %5d 0x%x %s %20s %s:%d:%s:<%s> %s" % (time_args (ts), pid, thread, level.name.ljust (5),
|
||||
category, filename, line, function,
|
||||
object_, message,)
|
||||
|
||||
class LogLines (object):
|
||||
|
||||
def __init__ (self, fileobj, line_cache):
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
def line_string (ts, pid, thread, level, category, filename, line, function,
|
||||
object_, message):
|
||||
|
||||
# Replicates gstreamer/gst/gstinfo.c:gst_debug_log_default.
|
||||
|
||||
# FIXME: Regarding object_, this doesn't fully replicate the formatting!
|
||||
return "%s %5d 0x%x %s %20s %s:%d:%s:<%s> %s" % (Data.time_args (ts), pid, thread,
|
||||
level.name.ljust (5), category,
|
||||
filename, line, function,
|
||||
object_, message,)
|
||||
|
||||
def main ():
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
sys.path.append (os.path.dirname (os.path.dirname (sys.argv[0])))
|
||||
|
||||
global Data
|
||||
from GstDebugViewer import Data
|
||||
|
||||
count = 100000
|
||||
|
@ -31,8 +43,8 @@ def main ():
|
|||
ts = i * 10000
|
||||
shift += i % (count // 100)
|
||||
level = levels[(i + shift) % 3]
|
||||
line = Data.LogLine ([ts, pid, thread, level, category, filename, file_line, function, object_, message])
|
||||
print line.line_string ()
|
||||
print line_string (ts, pid, thread, level, category, filename, file_line,
|
||||
function, object_, message)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main ()
|
||||
|
|
Loading…
Reference in a new issue