isl-org / isl-org/Open3D

change to root logger affects other projects

Open
#4,228 6 comments 1 reaction 0 assignees View on GitHub
pybind
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

**Describe the bug**
Open3D append to the Python root logger which in return yields doubled log messages when setting a logging handler in another project.

**To Reproduce**
Steps to reproduce the behavior:

```py
import logging
print(logging.getLogger().handlers) # > []
import opend3d
print(logging.getLogger().handlers) # > []
```

**Expected behavior**
Open3D should use `logging.getLogger(__name__)` and only change the open3D logger and not others.
This should give
```py
print(logging.getLogger(__name__).handlers) # > []
```
where `__name__ == "open3d"`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.