From c442a5ad806b6cccbb3ec4c5744b14b0c1f31a01 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 25 Feb 2019 00:17:46 -0800 Subject: 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. --- 046check_type_by_name.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '046check_type_by_name.cc') diff --git a/046check_type_by_name.cc b/046check_type_by_name.cc index ba40f521..6042068a 100644 --- a/046check_type_by_name.cc +++ b/046check_type_by_name.cc @@ -34,7 +34,7 @@ struct name_lt { :(code) void check_or_set_types_by_name(const recipe_ordinal r) { recipe& caller = get(Recipe, r); - trace(9991, "transform") << "--- deduce types for recipe " << caller.name << end(); + trace(101, "transform") << "--- deduce types for recipe " << caller.name << end(); for (int i = 0; i < SIZE(caller.steps); ++i) { instruction& inst = caller.steps.at(i); for (int in = 0; in < SIZE(inst.ingredients); ++in) @@ -62,7 +62,7 @@ void deduce_missing_type(set& known_types, reagent& x, const r if (known_types.find(x) == known_types.end()) return; const reagent& exemplar = *known_types.find(x); x.type = new type_tree(*exemplar.type); - trace(9992, "transform") << x.name << " <= " << names_to_string(x.type) << end(); + trace(102, "transform") << x.name << " <= " << names_to_string(x.type) << end(); // spaces are special; their type includes their /names property if (is_mu_space(x) && !has_property(x, "names")) { if (!has_property(exemplar, "names")) { @@ -82,7 +82,7 @@ void check_type(set& known_types, const reagent& x, const reci return; } if (known_types.find(x) == known_types.end()) { - trace(9992, "transform") << x.name << " => " << names_to_string(x.type) << end(); + trace(102, "transform") << x.name << " => " << names_to_string(x.type) << end(); known_types.insert(x); } if (!types_strictly_match(known_types.find(x)->type, x.type)) { -- cgit 1.4.1-2-gfad0