2007-11-20 13:58:52 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2011-11-06 11:41:08 +00:00
|
|
|
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,)
|
|
|
|
|
2007-11-20 13:58:52 +00:00
|
|
|
def main ():
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os.path
|
|
|
|
sys.path.append (os.path.dirname (os.path.dirname (sys.argv[0])))
|
|
|
|
|
2011-11-06 11:41:08 +00:00
|
|
|
global Data
|
2007-11-20 13:58:52 +00:00
|
|
|
from GstDebugViewer import Data
|
|
|
|
|
|
|
|
count = 100000
|
|
|
|
|
|
|
|
ts = 0
|
|
|
|
pid = 12345
|
|
|
|
thread = int ("89abcdef", 16)
|
|
|
|
level = Data.debug_level_log
|
|
|
|
category = "GST_DUMMY"
|
|
|
|
filename = "gstdummyfilename.c"
|
|
|
|
file_line = 1
|
|
|
|
function = "gst_dummy_function"
|
|
|
|
object_ = "dummyobj0"
|
|
|
|
message = "dummy message with no content"
|
|
|
|
|
|
|
|
levels = (Data.debug_level_log,
|
|
|
|
Data.debug_level_debug,
|
|
|
|
Data.debug_level_info,)
|
|
|
|
|
2007-11-22 09:56:34 +00:00
|
|
|
shift = 0
|
2007-11-20 13:58:52 +00:00
|
|
|
for i in xrange (count):
|
|
|
|
|
|
|
|
ts = i * 10000
|
2007-11-22 09:56:34 +00:00
|
|
|
shift += i % (count // 100)
|
|
|
|
level = levels[(i + shift) % 3]
|
2011-11-06 11:41:08 +00:00
|
|
|
print line_string (ts, pid, thread, level, category, filename, file_line,
|
|
|
|
function, object_, message)
|
2007-11-20 13:58:52 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main ()
|