Open3D
Open3D copied to clipboard
Log message got whole process stuck when I use python open3d and cpp lib together
Checklist
- [X] I have searched for similar issues.
- [X] For Python issues, I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
masterbranch).
Describe the issue
I found that when you use a pybind so lib and python open3d module together, some log info like "[Open3D INFO] Skipping non-triangle primitive geometry of type: 2" cannot steam itself out, and got the whole process stuck. Any one has a solution for this?
Steps to reproduce the bug
import open3d as o3d
from Pybind11SoLib import method
if __name__ == "__main__":
method(args)
Error message
Nothing output, process just stuck.
Expected behavior
No response
Open3D, Python and System information
- Operating system: Ubuntu 20.04
- Python version: Python 3.8
- Open3D version: 0.13.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip, build from source
- Compiler version (if built from source): gcc 9.4
Additional information
No response
I fix this isuue by redirect the logger print function, but still, I don't know why the log got the whole process stuck.
Redirct func looks like this:
utility::Logger::GetInstance().SetPrintFunction([](std::string const &msg) -> void { auto level = utility::Logger::GetInstance().GetVerbosityLevel(); switch (level) { case utility::VerbosityLevel::Error: LOG(ERROR)<<msg; break; case utility::VerbosityLevel::Warning: break; case utility::VerbosityLevel::Info: // LOG(INFO)<<msg; break; case utility::VerbosityLevel::Debug: // LOG(INFO)<<msg; break; default: break; } return; });