How can we print out the GLOG info level log when running Python code in PyTorch?
For example,

  
      github.com
  
  
    pytorch/pytorch/blob/master/torch/lib/c10d/ProcessGroupNCCL.cpp#L236 3

      // exception to users, after this, ncclCommWatchdog can detect nccl
      // communicators are aborted and clean up devNCCLCommMap_ accordingly.
      // if throwing timed out excepiton without aborting nccl communicators
      // here, it was observed that CUDA GPU will have 100% utilization and
      // can not run new events successfully.
      for (const auto& ncclComm : ncclComms_) {
        ncclComm->ncclCommAbort();
        const auto& storeKey = getNcclAbortedCommStoreKey(
            buildNcclUniqueIdStr(ncclComm->getNcclId()));
        store_->set(storeKey, {});
        LOG(INFO) << "Wrote aborted communicator id to store: " << storeKey;
      }
      throw std::runtime_error("Operation timed out!");
    }
    // Check for errors and throw appropriate exception.
    checkAndThrowException();
    std::this_thread::sleep_for(
        std::chrono::milliseconds(kSynchronizeBusyWaitMillis));
  }
  checkAndThrowException();
}



  
  
    
    
  
  


Checking https://github.com/pytorch/pytorch/blob/master/c10/util/Logging.cpp 11
It appears that we can set “caffe2_log_level” in c10 log.
Basically,
from caffe2.python import workspace
workspace.GlobalInit(['caffe2', '--caffe2_log_level=2'])

However, this only works for Caffe2 code but not c10 code in PyTorch backend.