summaryrefslogtreecommitdiff
path: root/buildscripts/mongosymb.py
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-04-04 13:33:12 -0400
committerMathias Stearn <mathias@10gen.com>2017-04-12 08:57:12 -0400
commit269a1e81c9d630ddf2a802a22a5bdcc9a0ff1b2b (patch)
treee965d8f682a90de0617edc3f31494a0c23d68d29 /buildscripts/mongosymb.py
parent80d05e9359bc527da0bc150d7aeac5a83d546775 (diff)
downloadmongo-269a1e81c9d630ddf2a802a22a5bdcc9a0ff1b2b.tar.gz
SERVER-28614 Make mongosymb.py ignore everything before the opening brace
Diffstat (limited to 'buildscripts/mongosymb.py')
-rwxr-xr-xbuildscripts/mongosymb.py9
1 files changed, 8 insertions, 1 deletions
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,