Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Log message got whole process stuck when I use python open3d and cpp lib together

Open Horizon-42 opened this issue 3 years ago • 1 comments

Checklist

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

Horizon-42 avatar Sep 01 '22 03:09 Horizon-42

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; });

Horizon-42 avatar Sep 01 '22 06:09 Horizon-42