From d059fe743df6a5e8a72fc1418f2c3ba1ed5ac1e6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 20 Oct 2016 00:37:24 -0700 Subject: 3524 --- html/003trace.cc.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'html/003trace.cc.html') diff --git a/html/003trace.cc.html b/html/003trace.cc.html index 7a7cb31f..d4618fb9 100644 --- a/html/003trace.cc.html +++ b/html/003trace.cc.html @@ -121,8 +121,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color :(before "End Globals") bool Hide_errors = false; +bool Dump_trace = false; :(before "End Setup") Hide_errors = false; +Dump_trace = false; :(before "End Types") // Pre-define some global constants that trace_stream needs to know about. @@ -168,7 +170,7 @@ Hide_errors = false;->str(); if (!curr_contents.empty()) { past_lines.push_back(trace_line(curr_depth, trim(curr_label), curr_contents)); // preserve indent in contents - if (!Hide_errors && curr_label == "error") + if (Dump_trace || (!Hide_errors && curr_label == "error")) cerr << curr_label << ": " << curr_contents << '\n'; } delete curr_stream; @@ -180,7 +182,7 @@ Hide_errors = false;(string label) { ostringstream output; label = trim(label); - for (vector<trace_line>::iterator p = past_lines.begin(); p != past_lines.end(); ++p) + for (vector<trace_line>::iterator p = past_lines.begin(); p != past_lines.end(); ++p) if (label.empty() || label == p->label) { output << std::setw(4) << p->depth << ' ' << p->label << ": " << p->contents << '\n'; } @@ -281,7 +283,7 @@ START_TRACING_UNTIL_END_OF_SCOPE if (curr_expected_line == SIZE(expected_lines)) return true; string label, contents; split_label_contents(expected_lines.at(curr_expected_line), &label, &contents); - for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { + for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { if (label != p->label) continue; if (contents != trim(p->contents)) continue; ++curr_expected_line; @@ -318,7 +320,7 @@ START_TRACING_UNTIL_END_OF_SCOPE } bool line_exists_anywhere(const string& label, const string& contents) { - for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { + for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { if (label != p->label) continue; if (contents == trim(p->contents)) return true; } @@ -332,7 +334,7 @@ START_TRACING_UNTIL_END_OF_SCOPE int trace_count(string label, string line) { if (!Trace_stream) return 0; long result = 0; - for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { + for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { if (label == p->label) { if (line == "" || trim(line) == trim(p->contents)) ++result; @@ -344,7 +346,7 @@ START_TRACING_UNTIL_END_OF_SCOPE int trace_count_prefix(string label, string prefix) { if (!Trace_stream) return 0; long result = 0; - for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { + for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { if (label == p->label) { if (starts_with(trim(p->contents), trim(prefix))) ++result; -- cgit 1.4.1-2-gfad0