Browse Source

Prettier log output

default_compile_flags
vector-of-bool 5 years ago
parent
commit
eeca842437
2 changed files with 5 additions and 8 deletions
  1. +4
    -7
      src/dds/build/plan/compile_file.cpp
  2. +1
    -1
      src/dds/dds.main.cpp

+ 4
- 7
src/dds/build/plan/compile_file.cpp View File

const auto obj_path = calc_object_file_path(env); const auto obj_path = calc_object_file_path(env);
fs::create_directories(obj_path.parent_path()); fs::create_directories(obj_path.parent_path());


spdlog::info("[{}] Compile: {}",
_qualifier,
fs::relative(_source.path, _source.basis_path).string());
auto msg = fmt::format("[{}] Compile: {:40}", _qualifier, fs::relative(_source.path, _source.basis_path).string());
spdlog::info(msg);
auto start_time = std::chrono::steady_clock::now(); auto start_time = std::chrono::steady_clock::now();


auto cmd = generate_compile_command(env); auto cmd = generate_compile_command(env);
auto end_time = std::chrono::steady_clock::now(); auto end_time = std::chrono::steady_clock::now();
auto dur_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time); auto dur_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);


spdlog::info("[{}] Compile: {} - {:n}ms",
_qualifier,
fs::relative(_source.path, _source.basis_path).string(),
dur_ms.count());
spdlog::info("{} - {:>5n}ms", msg, dur_ms.count());


if (!compile_res.okay()) { if (!compile_res.okay()) {
spdlog::error("Compilation failed: {}", _source.path.string()); spdlog::error("Compilation failed: {}", _source.path.string());

+ 1
- 1
src/dds/dds.main.cpp View File

*/ */


int main(int argc, char** argv) { int main(int argc, char** argv) {
spdlog::set_pattern("[%H:%M:%S] [%^%l%$] %v");
spdlog::set_pattern("[%H:%M:%S] [%^%-5l%$] %v");
args::ArgumentParser parser("DDS - The drop-dead-simple library manager"); args::ArgumentParser parser("DDS - The drop-dead-simple library manager");


cli_base cli{parser}; cli_base cli{parser};

Loading…
Cancel
Save