#include <range/v3/view/concat.hpp> | #include <range/v3/view/concat.hpp> | ||||
#include <range/v3/view/group_by.hpp> | #include <range/v3/view/group_by.hpp> | ||||
#include <range/v3/view/transform.hpp> | #include <range/v3/view/transform.hpp> | ||||
#include <spdlog/spdlog.h> | |||||
#include <dds/3rd/args.hxx> | #include <dds/3rd/args.hxx> | ||||
return std::move(*tc); | return std::move(*tc); | ||||
} else { | } else { | ||||
return dds::parse_toolchain_json5(dds::slurp_file(tc_path)); | return dds::parse_toolchain_json5(dds::slurp_file(tc_path)); | ||||
// return dds::parse_toolchain_dds(dds::slurp_file(tc_path)); | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
*/ | */ | ||||
int main_fn(const std::vector<std::string>& argv) { | int main_fn(const std::vector<std::string>& argv) { | ||||
spdlog::set_pattern("[%H:%M:%S] [%^%-5l%$] %v"); | |||||
dds::log::init_logger(); | |||||
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}; |
} | } | ||||
#endif | #endif | ||||
void dds::log::init_logger() noexcept { | |||||
// spdlog::set_pattern("[%H:%M:%S] [%^%-5l%$] %v"); | |||||
spdlog::set_pattern("[%^%-5l%$] %v"); | |||||
} | |||||
void dds::log::log_print(dds::log::level l, std::string_view msg) noexcept { | void dds::log::log_print(dds::log::level l, std::string_view msg) noexcept { | ||||
static auto logger_inst = [] { | static auto logger_inst = [] { | ||||
auto logger = spdlog::default_logger_raw(); | auto logger = spdlog::default_logger_raw(); | ||||
return spdlog::level::err; | return spdlog::level::err; | ||||
case level::critical: | case level::critical: | ||||
return spdlog::level::critical; | return spdlog::level::critical; | ||||
case level::_silent: | |||||
return spdlog::level::off; | |||||
} | } | ||||
neo_assert_always(invariant, false, "Invalid log level", msg, int(l)); | neo_assert_always(invariant, false, "Invalid log level", msg, int(l)); | ||||
}(); | }(); |
warn, | warn, | ||||
error, | error, | ||||
critical, | critical, | ||||
_silent, | |||||
}; | }; | ||||
inline level current_log_level = level::info; | inline level current_log_level = level::info; | ||||
void log_print(level l, std::string_view s) noexcept; | void log_print(level l, std::string_view s) noexcept; | ||||
void init_logger() noexcept; | |||||
template <typename T> | template <typename T> | ||||
concept formattable = requires(const T item) { | concept formattable = requires(const T item) { | ||||
fmt::format("{}", item); | fmt::format("{}", item); |