diff options
Diffstat (limited to 'bpkg/diagnostics.cxx')
-rw-r--r-- | bpkg/diagnostics.cxx | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/bpkg/diagnostics.cxx b/bpkg/diagnostics.cxx index 844f911..cf096d1 100644 --- a/bpkg/diagnostics.cxx +++ b/bpkg/diagnostics.cxx @@ -1,5 +1,4 @@ // file : bpkg/diagnostics.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include <bpkg/diagnostics.hxx> @@ -8,8 +7,8 @@ #include <odb/statement.hxx> -#include <libbutl/process.mxx> -#include <libbutl/process-io.mxx> // operator<<(ostream, process_arg) +#include <libbutl/process.hxx> // process_args +#include <libbutl/process-io.hxx> // operator<<(ostream, process_*) #include <bpkg/utility.hxx> @@ -23,14 +22,31 @@ namespace bpkg void print_process (const char* const args[], size_t n) { - diag_record r (text); - print_process (r, args, n); + diag_record dr (text); + print_process (dr, args, n); } void - print_process (diag_record& r, const char* const args[], size_t n) + print_process (diag_record& dr, const char* const args[], size_t n) { - r << process_args {args, n}; + dr << process_args {args, n}; + } + + void + print_process (const process_env& pe, const char* const args[], size_t n) + { + diag_record dr (text); + print_process (dr, pe, args, n); + } + + void + print_process (diag_record& dr, + const process_env& pe, const char* const args[], size_t n) + { + if (pe.env ()) + dr << pe << ' '; + + dr << process_args {args, n}; } // Diagnostics verbosity level. @@ -87,7 +103,7 @@ namespace bpkg void trace_mark_base:: execute (odb::connection&, const char* stmt) { - if (verb >= 5) + if (verb >= 6) static_cast<trace_mark&> (*this) << stmt; } @@ -113,7 +129,7 @@ namespace bpkg const basic_mark error ("error"); const basic_mark warn ("warning"); const basic_mark info ("info"); - const basic_mark text (nullptr); + const basic_mark text (nullptr, nullptr, nullptr, nullptr); // No frame. const fail_mark fail ("error"); const fail_end endf; } |