mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-11 13:30:47 -04:00
Logger cleanup
This commit is contained in:
parent
c075eaab0e
commit
ad09f4517d
@ -55,7 +55,7 @@ class cached_block {
|
|||||||
b.compression(), mm->as<uint8_t>(b.start()), b.length(), data_))
|
b.compression(), mm->as<uint8_t>(b.start()), b.length(), data_))
|
||||||
, mm_(std::move(mm))
|
, mm_(std::move(mm))
|
||||||
, section_(b)
|
, section_(b)
|
||||||
, log_(lgr)
|
, LOG_PROXY_INIT(lgr)
|
||||||
, release_(release) {
|
, release_(release) {
|
||||||
if (!section_.check_fast(*mm_)) {
|
if (!section_.check_fast(*mm_)) {
|
||||||
DWARFS_THROW(runtime_error, "block data integrity check failed");
|
DWARFS_THROW(runtime_error, "block data integrity check failed");
|
||||||
@ -112,7 +112,7 @@ class cached_block {
|
|||||||
std::unique_ptr<block_decompressor> decompressor_;
|
std::unique_ptr<block_decompressor> decompressor_;
|
||||||
std::shared_ptr<mmif> mm_;
|
std::shared_ptr<mmif> mm_;
|
||||||
fs_section section_;
|
fs_section section_;
|
||||||
log_proxy<debug_logger_policy> log_;
|
LOG_PROXY_DECL(debug_logger_policy);
|
||||||
bool const release_;
|
bool const release_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ class block_cache_ final : public block_cache::impl {
|
|||||||
: std::thread::hardware_concurrency(),
|
: std::thread::hardware_concurrency(),
|
||||||
static_cast<size_t>(1)))
|
static_cast<size_t>(1)))
|
||||||
, mm_(std::move(mm))
|
, mm_(std::move(mm))
|
||||||
, log_(lgr)
|
, LOG_PROXY_INIT(lgr)
|
||||||
, options_(options) {}
|
, options_(options) {}
|
||||||
|
|
||||||
~block_cache_() noexcept override {
|
~block_cache_() noexcept override {
|
||||||
@ -558,7 +558,7 @@ class block_cache_ final : public block_cache::impl {
|
|||||||
mutable worker_group wg_;
|
mutable worker_group wg_;
|
||||||
std::vector<fs_section> block_;
|
std::vector<fs_section> block_;
|
||||||
std::shared_ptr<mmif> mm_;
|
std::shared_ptr<mmif> mm_;
|
||||||
log_proxy<LoggerPolicy> log_;
|
LOG_PROXY_DECL(LoggerPolicy);
|
||||||
const block_cache_options options_;
|
const block_cache_options options_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ class block_manager_ final : public block_manager::impl {
|
|||||||
public:
|
public:
|
||||||
block_manager_(logger& lgr, progress& prog, const block_manager::config& cfg,
|
block_manager_(logger& lgr, progress& prog, const block_manager::config& cfg,
|
||||||
std::shared_ptr<os_access> os, filesystem_writer& fsw)
|
std::shared_ptr<os_access> os, filesystem_writer& fsw)
|
||||||
: log_{lgr}
|
: LOG_PROXY_INIT(lgr)
|
||||||
, prog_{prog}
|
, prog_{prog}
|
||||||
, cfg_{cfg}
|
, cfg_{cfg}
|
||||||
, os_{std::move(os)}
|
, os_{std::move(os)}
|
||||||
@ -314,7 +314,7 @@ class block_manager_ final : public block_manager::impl {
|
|||||||
return (1 << cfg_.bloom_filter_size) * hash_count;
|
return (1 << cfg_.bloom_filter_size) * hash_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_proxy<LoggerPolicy> log_;
|
LOG_PROXY_DECL(LoggerPolicy);
|
||||||
progress& prog_;
|
progress& prog_;
|
||||||
const block_manager::config& cfg_;
|
const block_manager::config& cfg_;
|
||||||
std::shared_ptr<os_access> os_;
|
std::shared_ptr<os_access> os_;
|
||||||
|
@ -78,7 +78,7 @@ template <typename LoggerPolicy>
|
|||||||
class filesystem_extractor_ final : public filesystem_extractor::impl {
|
class filesystem_extractor_ final : public filesystem_extractor::impl {
|
||||||
public:
|
public:
|
||||||
explicit filesystem_extractor_(logger& lgr)
|
explicit filesystem_extractor_(logger& lgr)
|
||||||
: log_{lgr} {}
|
: LOG_PROXY_INIT(lgr) {}
|
||||||
|
|
||||||
~filesystem_extractor_() override {
|
~filesystem_extractor_() override {
|
||||||
try {
|
try {
|
||||||
@ -191,7 +191,7 @@ class filesystem_extractor_ final : public filesystem_extractor::impl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log_proxy<debug_logger_policy> log_;
|
LOG_PROXY_DECL(debug_logger_policy);
|
||||||
struct ::archive* a_{nullptr};
|
struct ::archive* a_{nullptr};
|
||||||
int pipefd_[2]{-1, -1};
|
int pipefd_[2]{-1, -1};
|
||||||
std::unique_ptr<std::thread> iot_;
|
std::unique_ptr<std::thread> iot_;
|
||||||
|
@ -259,7 +259,7 @@ make_metadata(logger& lgr, std::shared_ptr<mmif> mm,
|
|||||||
template <typename LoggerPolicy>
|
template <typename LoggerPolicy>
|
||||||
class filesystem_ final : public filesystem_v2::impl {
|
class filesystem_ final : public filesystem_v2::impl {
|
||||||
public:
|
public:
|
||||||
filesystem_(logger& lgr_, std::shared_ptr<mmif> mm,
|
filesystem_(logger& lgr, std::shared_ptr<mmif> mm,
|
||||||
const filesystem_options& options, int inode_offset);
|
const filesystem_options& options, int inode_offset);
|
||||||
|
|
||||||
void dump(std::ostream& os, int detail_level) const override;
|
void dump(std::ostream& os, int detail_level) const override;
|
||||||
|
@ -46,7 +46,7 @@ class inode_reader_ final : public inode_reader_v2::impl {
|
|||||||
public:
|
public:
|
||||||
inode_reader_(logger& lgr, block_cache&& bc)
|
inode_reader_(logger& lgr, block_cache&& bc)
|
||||||
: cache_(std::move(bc))
|
: cache_(std::move(bc))
|
||||||
, log_(lgr)
|
, LOG_PROXY_INIT(lgr)
|
||||||
, iovec_sizes_(1, 0, 256) {}
|
, iovec_sizes_(1, 0, 256) {}
|
||||||
|
|
||||||
~inode_reader_() override {
|
~inode_reader_() override {
|
||||||
@ -78,7 +78,7 @@ class inode_reader_ final : public inode_reader_v2::impl {
|
|||||||
const StoreFunc& store) const;
|
const StoreFunc& store) const;
|
||||||
|
|
||||||
block_cache cache_;
|
block_cache cache_;
|
||||||
log_proxy<LoggerPolicy> log_;
|
LOG_PROXY_DECL(LoggerPolicy);
|
||||||
mutable folly::Histogram<size_t> iovec_sizes_;
|
mutable folly::Histogram<size_t> iovec_sizes_;
|
||||||
mutable std::mutex iovec_sizes_mutex_;
|
mutable std::mutex iovec_sizes_mutex_;
|
||||||
};
|
};
|
||||||
|
@ -297,7 +297,7 @@ class metadata_ final : public metadata_v2::impl {
|
|||||||
, global_(lgr, &meta_,
|
, global_(lgr, &meta_,
|
||||||
options.check_consistency || force_consistency_check)
|
options.check_consistency || force_consistency_check)
|
||||||
, root_(dir_entry_view::from_dir_entry_index(0, &global_))
|
, root_(dir_entry_view::from_dir_entry_index(0, &global_))
|
||||||
, log_(lgr)
|
, LOG_PROXY_INIT(lgr)
|
||||||
, inode_offset_(inode_offset)
|
, inode_offset_(inode_offset)
|
||||||
, symlink_inode_offset_(find_inode_offset(inode_rank::INO_LNK))
|
, symlink_inode_offset_(find_inode_offset(inode_rank::INO_LNK))
|
||||||
, file_inode_offset_(find_inode_offset(inode_rank::INO_REG))
|
, file_inode_offset_(find_inode_offset(inode_rank::INO_REG))
|
||||||
@ -714,7 +714,7 @@ class metadata_ final : public metadata_v2::impl {
|
|||||||
MappedFrozen<thrift::metadata::metadata> meta_;
|
MappedFrozen<thrift::metadata::metadata> meta_;
|
||||||
const global_metadata global_;
|
const global_metadata global_;
|
||||||
dir_entry_view root_;
|
dir_entry_view root_;
|
||||||
log_proxy<LoggerPolicy> log_;
|
LOG_PROXY_DECL(LoggerPolicy);
|
||||||
const int inode_offset_;
|
const int inode_offset_;
|
||||||
const int symlink_inode_offset_;
|
const int symlink_inode_offset_;
|
||||||
const int file_inode_offset_;
|
const int file_inode_offset_;
|
||||||
|
@ -122,7 +122,7 @@ class script_options : public options_interface {
|
|||||||
public:
|
public:
|
||||||
script_options(logger& lgr, po::variables_map& vm, scanner_options& opts,
|
script_options(logger& lgr, po::variables_map& vm, scanner_options& opts,
|
||||||
bool& force_similarity)
|
bool& force_similarity)
|
||||||
: log_(lgr)
|
: LOG_PROXY_INIT(lgr)
|
||||||
, vm_(vm)
|
, vm_(vm)
|
||||||
, opts_(opts)
|
, opts_(opts)
|
||||||
, force_similarity_(force_similarity) {}
|
, force_similarity_(force_similarity) {}
|
||||||
@ -163,7 +163,7 @@ class script_options : public options_interface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log_proxy<debug_logger_policy> log_;
|
LOG_PROXY_DECL(debug_logger_policy);
|
||||||
po::variables_map& vm_;
|
po::variables_map& vm_;
|
||||||
scanner_options& opts_;
|
scanner_options& opts_;
|
||||||
bool& force_similarity_;
|
bool& force_similarity_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user