diff options
author | René Stadler <mail@renestadler.de> | 2011-11-06 12:41:08 +0100 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2011-11-06 12:41:08 +0100 |
commit | 4c0dccac95231eefcfb62d4a596af535339a0b11 (patch) | |
tree | 10be462b263f03fc19680cacfddb92e53c24e0d2 /tests | |
parent | 8107642ab5b061f5f77f474aef6167c9d8d2b0fe (diff) |
Data: remove log line serialization
This is incomplete and prone to error. Move it out into the utility script
(which is the only user).
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/create-test-log.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/create-test-log.py b/tests/create-test-log.py index f450161..be404dd 100755 --- a/tests/create-test-log.py +++ b/tests/create-test-log.py @@ -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 () |