Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use named logger instead of root logger #205

Closed
Breakthrough opened this issue Feb 3, 2021 · 2 comments
Closed

Use named logger instead of root logger #205

Breakthrough opened this issue Feb 3, 2021 · 2 comments

Comments

@Breakthrough
Copy link
Owner

Breakthrough commented Feb 3, 2021

Currently, PySceneDetect uses the root logger with a basic configuration. It should be replaced with an explicitly named logger instead to avoid conflicts with other projects using scenedetect as a dependency.

Furthermore, some objects/functions take explicit logger objects as an argument. Modify them to use the named logger instead.

Lastly, ensure that when the package is imported, the named logger is instantiated immediately but with the highest warning level. Only override it when instantiating the CLI.

@Breakthrough
Copy link
Owner Author

This only needs to be done for non-CLI parts of the library fortunately, which currently the only things that log messages are scene_manager.py, stats_manager.py, and video_splitter.py. This also indicates that better logging could be implemented throughout the library rather than only for the CLI, but that can be an improvement made in the v1.0 refactor.

@Breakthrough
Copy link
Owner Author

Due to conflicts with the root logger, ended up just transitioning everything to use a named logger called pyscenedetect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant