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