From 269a1e81c9d630ddf2a802a22a5bdcc9a0ff1b2b Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 4 Apr 2017 13:33:12 -0400 Subject: SERVER-28614 Make mongosymb.py ignore everything before the opening brace --- buildscripts/mongosymb.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'buildscripts/mongosymb.py') diff --git a/buildscripts/mongosymb.py b/buildscripts/mongosymb.py index 974671d080c..4da05350558 100755 --- a/buildscripts/mongosymb.py +++ b/buildscripts/mongosymb.py @@ -173,8 +173,15 @@ def main(argv): sys.stderr.write("Invalid output-format argument: %s\n" % options.output_format) sys.exit(1) + + # Skip over everything before the first '{' since it is likely to be log line prefixes. + # Additionally, using raw_decode() to ignore extra data after the closing '}' to allow maximal + # sloppiness in copy-pasting input. + trace_doc = sys.stdin.read() + trace_doc = trace_doc[trace_doc.find('{'):] + trace_doc = json.JSONDecoder().raw_decode(trace_doc)[0] + resolver = resolver_constructor(*args[1:]) - trace_doc = json.load(sys.stdin) frames = symbolize_frames(trace_doc, resolver, symbolizer_path=options.symbolizer_path, -- cgit v1.2.1