Fix and optimize logger (#4002)
* Fix logging switch statement. * Remove debug_verbose_ in AllReducer. * Don't construct the stream when not needed. * Make default constructor deleted. * Remove redundant IsVerbose.
This commit is contained in:
@@ -971,9 +971,7 @@ class GPUHistMakerSpecialised{
|
||||
device_list_[index] = device_id;
|
||||
}
|
||||
|
||||
reducer_.Init(
|
||||
device_list_,
|
||||
ConsoleLogger::GlobalVerbosity() > ConsoleLogger::DefaultVerbosity());
|
||||
reducer_.Init(device_list_);
|
||||
|
||||
auto batch_iter = dmat->GetRowBatches().begin();
|
||||
const SparsePage& batch = *batch_iter;
|
||||
|
||||
@@ -206,10 +206,6 @@ void QuantileHistMaker::Builder::Update(const GHistIndexMatrix& gmat,
|
||||
|
||||
pruner_->Update(gpair, p_fmat, std::vector<RegTree*>{p_tree});
|
||||
|
||||
if (ConsoleLogger::GlobalVerbosity() <= ConsoleLogger::DefaultVerbosity()) {
|
||||
// Don't construct the following huge stream.
|
||||
return;
|
||||
}
|
||||
double total_time = dmlc::GetTime() - gstart;
|
||||
LOG(INFO) << "\nInitData: "
|
||||
<< std::fixed << std::setw(6) << std::setprecision(4) << time_init_data
|
||||
|
||||
Reference in New Issue
Block a user