diff --git a/_pyceres/logging.h b/_pyceres/logging.h index 05c78fd..bf6df04 100644 --- a/_pyceres/logging.h +++ b/_pyceres/logging.h @@ -211,8 +211,10 @@ void BindLogging(py::module& m) { .value("ERROR", Logging::LogSeverity::GLOG_ERROR) .value("FATAL", Logging::LogSeverity::GLOG_FATAL) .export_values(); - google::InitGoogleLogging(""); - google::InstallFailureSignalHandler(); - google::InstallFailureFunction(&PyBindLogTermination); + if (!google::IsGoogleLoggingInitialized()) { + google::InitGoogleLogging(""); + google::InstallFailureSignalHandler(); + google::InstallFailureFunction(&PyBindLogTermination); + } FLAGS_alsologtostderr = true; }