about summary refs log tree commit diff stats
path: root/019type_abbreviations.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-02-25 00:17:46 -0800
committerKartik Agaram <vc@akkartik.com>2019-02-25 01:50:53 -0800
commitc442a5ad806b6cccbb3ec4c5744b14b0c1f31a01 (patch)
tree318fb1d56e7ee3c750635d3326ad0739dfdacefe /019type_abbreviations.cc
parente5998f74ac29bb4bf2aedfdd6fbea801ffdb08f6 (diff)
downloadmu-c442a5ad806b6cccbb3ec4c5744b14b0c1f31a01.tar.gz
4987 - support `browse_trace` tool in SubX
I've extracted it into a separate binary, independent of my Mu prototype.

I also cleaned up my tracing layer to be a little nicer. Major improvements:

- Realized that incremental tracing really ought to be the default.
  And to minimize printing traces to screen.

- Finally figured out how to combine layers and call stack frames in a
  single dimension of depth. The answer: optimize for the experience of
  `browse_trace`. Instructions occupy a range of depths based on their call
  stack frame, and minor details of an instruction lie one level deeper
  in each case.

Other than that, I spent some time adjusting levels everywhere to make
`browse_trace` useful.
Diffstat (limited to '019type_abbreviations.cc')
-rw-r--r--019type_abbreviations.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/019type_abbreviations.cc b/019type_abbreviations.cc
index df797dfa..dfa214c9 100644
--- a/019type_abbreviations.cc
+++ b/019type_abbreviations.cc
@@ -50,7 +50,7 @@ void load_type_abbreviations(istream& in) {
     raise << "'type' conflict: '" << new_type_name << "' defined as both '" << names_to_string_without_quotes(get(Type_abbreviations, new_type_name)) << "' and '" << old << "'\n" << end();
     return;
   }
-  trace(9990, "type") << "alias " << new_type_name << " = " << old << end();
+  trace(100, "type") << "alias " << new_type_name << " = " << old << end();
   type_tree* old_type = new_type_tree(old);
   put(Type_abbreviations, new_type_name, old_type);
 }
@@ -168,17 +168,17 @@ void expand_type_abbreviations(const recipe_ordinal r) {
 }
 
 void expand_type_abbreviations(const recipe& caller) {
-  trace(9991, "transform") << "--- expand type abbreviations in recipe '" << caller.name << "'" << end();
+  trace(101, "transform") << "--- expand type abbreviations in recipe '" << caller.name << "'" << end();
   for (int i = 0;  i < SIZE(caller.steps);  ++i) {
     const instruction& inst = caller.steps.at(i);
-    trace(9991, "transform") << "instruction '" << to_original_string(inst) << end();
+    trace(102, "transform") << "instruction '" << to_original_string(inst) << end();
     for (long int i = 0;  i < SIZE(inst.ingredients);  ++i) {
       expand_type_abbreviations(inst.ingredients.at(i).type);
-      trace(9992, "transform") << "ingredient type after expanding abbreviations: " << names_to_string(inst.ingredients.at(i).type) << end();
+      trace(102, "transform") << "ingredient type after expanding abbreviations: " << names_to_string(inst.ingredients.at(i).type) << end();
     }
     for (long int i = 0;  i < SIZE(inst.products);  ++i) {
       expand_type_abbreviations(inst.products.at(i).type);
-      trace(9992, "transform") << "product type after expanding abbreviations: " << names_to_string(inst.products.at(i).type) << end();
+      trace(102, "transform") << "product type after expanding abbreviations: " << names_to_string(inst.products.at(i).type) << end();
     }
   }
   // End Expand Type Abbreviations(caller)