about summary refs log tree commit diff stats
path: root/003trace.cc
diff options
context:
space:
mode:
Diffstat (limited to '003trace.cc')
-rw-r--r--003trace.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/003trace.cc b/003trace.cc
index 7a062b63..7c9801e8 100644
--- a/003trace.cc
+++ b/003trace.cc
@@ -117,6 +117,12 @@ struct trace_stream {
     return *curr_stream;
   }
 
+  void dump() {
+    ofstream fout("last_run");
+    fout << readable_contents("");
+    fout.close();
+  }
+
   // be sure to call this before messing with curr_stream or curr_label
   void newline();
   // useful for debugging
@@ -214,11 +220,7 @@ struct lease_tracer {
 lease_tracer::lease_tracer() { Trace_stream = new trace_stream; }
 lease_tracer::~lease_tracer() {
   if (!Trace_stream) return;  // in case tests close Trace_stream
-  if (Save_trace) {
-    ofstream fout("last_run");
-    fout << Trace_stream->readable_contents("");
-    fout.close();
-  }
+  if (Save_trace) Trace_stream->dump();
   delete Trace_stream, Trace_stream = NULL;
 }
 :(before "End Includes")