mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-08 03:49:44 -04:00
Contextual option logging
This commit is contained in:
parent
5d191a6dbf
commit
a75381b0ef
@ -24,6 +24,7 @@
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
@ -178,6 +179,12 @@ class contextual_option_parser {
|
||||
}
|
||||
}
|
||||
|
||||
std::string as_string() const {
|
||||
std::ostringstream oss;
|
||||
dump(oss);
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
private:
|
||||
void add_contextual(typename option_type::context_type const& ctx,
|
||||
typename option_type::value_type const& val) const {
|
||||
|
@ -977,7 +977,7 @@ int mkdwarfs_main(int argc, sys_char** argv) {
|
||||
contextual_option_parser cop("--order", options.inode.fragment_order, cp,
|
||||
order_parser);
|
||||
cop.parse(order);
|
||||
cop.dump(std::cerr);
|
||||
LOG_DEBUG << cop.as_string();
|
||||
} catch (std::exception const& e) {
|
||||
LOG_ERROR << e.what();
|
||||
return 1;
|
||||
@ -988,7 +988,7 @@ int mkdwarfs_main(int argc, sys_char** argv) {
|
||||
contextual_option_parser cop("--max-lookback-blocks", max_lookback_opt, cp,
|
||||
max_lookback_parser);
|
||||
cop.parse(max_lookback_blocks);
|
||||
cop.dump(std::cerr);
|
||||
LOG_DEBUG << cop.as_string();
|
||||
} catch (std::exception const& e) {
|
||||
LOG_ERROR << e.what();
|
||||
return 1;
|
||||
@ -999,7 +999,7 @@ int mkdwarfs_main(int argc, sys_char** argv) {
|
||||
contextual_option_parser cop("--window-size", window_size_opt, cp,
|
||||
window_size_parser);
|
||||
cop.parse(window_size);
|
||||
cop.dump(std::cerr);
|
||||
LOG_DEBUG << cop.as_string();
|
||||
} catch (std::exception const& e) {
|
||||
LOG_ERROR << e.what();
|
||||
return 1;
|
||||
@ -1010,7 +1010,7 @@ int mkdwarfs_main(int argc, sys_char** argv) {
|
||||
contextual_option_parser cop("--window-step", window_step_opt, cp,
|
||||
window_step_parser);
|
||||
cop.parse(window_step);
|
||||
cop.dump(std::cerr);
|
||||
LOG_DEBUG << cop.as_string();
|
||||
} catch (std::exception const& e) {
|
||||
LOG_ERROR << e.what();
|
||||
return 1;
|
||||
@ -1021,7 +1021,7 @@ int mkdwarfs_main(int argc, sys_char** argv) {
|
||||
contextual_option_parser cop("--compression", compression_opt, cp,
|
||||
compressor_parser);
|
||||
cop.parse(compression);
|
||||
cop.dump(std::cerr);
|
||||
LOG_DEBUG << cop.as_string();
|
||||
|
||||
compression_opt.visit_contextual([catmgr = options.inode.categorizer_mgr](
|
||||
auto cat, block_compressor const& bc) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user