From eb264e1892c2a1379fa3bcab9aefea219e8e7138 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Sep 2015 10:56:32 +0200 Subject: Rework diagnostics verbosity, add quiet mode/option --- build/cxx/compile.cxx | 24 ++++++++++++------------ build/cxx/link.cxx | 8 ++++---- build/cxx/module.cxx | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'build/cxx') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index 9a3e3d7..d986cac 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -58,7 +58,7 @@ namespace build return p; } - level3 ([&]{trace << "no c++ source file for target " << t;}); + level4 ([&]{trace << "no c++ source file for target " << t;}); return nullptr; } @@ -236,7 +236,7 @@ namespace build else continue; - level5 ([&]{trace << "-I '" << d << "'";}); + level6 ([&]{trace << "-I '" << d << "'";}); // If we are relative or not inside our project root, then // ignore. @@ -268,7 +268,7 @@ namespace build // be reasonably expected to work according to the order // of the -I options. // - if (verb >= 3) + if (verb >= 4) trace << "overriding dependency prefix '" << p << "'\n" << " old mapping to " << j->second << "\n" << " new mapping to " << d; @@ -278,7 +278,7 @@ namespace build } else { - level5 ([&]{trace << "'" << p << "' = '" << d << "'";}); + level6 ([&]{trace << "'" << p << "' = '" << d << "'";}); m.emplace (move (p), move (d)); } } @@ -418,7 +418,7 @@ namespace build args.push_back (s.path ().string ().c_str ()); args.push_back (nullptr); - level5 ([&]{trace << "target: " << t;}); + level6 ([&]{trace << "target: " << t;}); // Build the prefix map lazily only if we have non-existent files. // Also reuse it over restarts since it doesn't change. @@ -461,7 +461,7 @@ namespace build { restart = false; - if (verb >= 2) + if (verb >= 3) print_process (args); try @@ -539,9 +539,9 @@ namespace build if (!f.absolute ()) { // This is probably as often an error as an auto-generated - // file, so trace at level 3. + // file, so trace at level 4. // - level3 ([&]{trace << "non-existent header '" << f << "'";}); + level4 ([&]{trace << "non-existent header '" << f << "'";}); // If we already did it and build_prefix_map() returned empty, // then we would have failed below. @@ -582,7 +582,7 @@ namespace build f = i->second / f; } - level5 ([&]{trace << "injecting " << f;}); + level6 ([&]{trace << "injecting " << f;}); // Split the name into its directory part, the name part, and // extension. Here we can assume the name part is a valid @@ -667,7 +667,7 @@ namespace build if (ns != os && ns != target_state::unchanged) { - level5 ([&]{trace << "updated " << pt << ", restarting";}); + level6 ([&]{trace << "updated " << pt << ", restarting";}); restart = true; } } @@ -754,9 +754,9 @@ namespace build args.push_back (nullptr); - if (verb) + if (verb >= 2) print_process (args); - else + else if (verb) text << "c++ " << *s; try diff --git a/build/cxx/link.cxx b/build/cxx/link.cxx index 2554930..6742ff2 100644 --- a/build/cxx/link.cxx +++ b/build/cxx/link.cxx @@ -113,7 +113,7 @@ namespace build args.push_back ("-print-search-dirs"); args.push_back (nullptr); - if (verb >= 5) + if (verb >= 3) print_process (args); string l; @@ -399,7 +399,7 @@ namespace build // if (seen_c && !seen_cxx && hint < "cxx") { - level3 ([&]{trace << "c prerequisite(s) without c++ or hint";}); + level4 ([&]{trace << "c prerequisite(s) without c++ or hint";}); return nullptr; } @@ -807,9 +807,9 @@ namespace build args.push_back (nullptr); - if (verb) + if (verb >= 2) print_process (args); - else + else if (verb) text << "ld " << t; try diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx index 6b7da80..eda3593 100644 --- a/build/cxx/module.cxx +++ b/build/cxx/module.cxx @@ -35,7 +35,7 @@ namespace build bool first) { tracer trace ("cxx::init"); - level4 ([&]{trace << "for " << b.out_path ();}); + level5 ([&]{trace << "for " << b.out_path ();}); // Initialize the bin module. Only do this if it hasn't already // been loaded so that we don't overwrite user's bin.* settings. @@ -148,9 +148,9 @@ namespace build const string& cxx (as (p.first)); const char* args[] = {cxx.c_str (), "-dumpversion", nullptr}; - if (verb) + if (verb >= 2) print_process (args); - else + else if (verb) text << "test " << cxx; string ver; @@ -177,7 +177,7 @@ namespace build throw failed (); } - if (verb) + if (verb >= 2) text << cxx << " " << ver; } } -- cgit v1.1