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

The root logger has been used illegally. #751

Closed
oniatsu opened this issue Mar 28, 2024 · 4 comments
Closed

The root logger has been used illegally. #751

oniatsu opened this issue Mar 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@oniatsu
Copy link

oniatsu commented Mar 28, 2024

Bug report

Describe the bug

The root logger has been used illegally.

The root logger is dirty just by importing the package.
The package should work without affecting the root logger.

To Reproduce

  1. pip install supabase==2.4.1
  2. Run the code

code

import logging

import supabase

logger = logging.getLogger(__name__)
print(logger.hasHandlers())
print(logger.handlers)

root_logger = logging.getLogger()
print(root_logger.handlers)

result

True
[]
[<StreamHandler <stderr> (NOTSET)>]

Expected behavior

code

import logging

# import supabase # comment out

logger = logging.getLogger(__name__)
print(logger.hasHandlers())
print(logger.handlers)

root_logger = logging.getLogger()
print(root_logger.handlers)

result

False
[]
[]

System information

  • OS: macOS
  • Version of supabase-py: 2.4.1
  • Version of Python: Python 3.11.5
@oniatsu oniatsu added the bug Something isn't working label Mar 28, 2024
@silentworks
Copy link
Contributor

Closing this out as I believe it has been resolved.

@oniatsu
Copy link
Author

oniatsu commented May 23, 2024

@silentworks I checked with the latest version and it is not fixed.

import logging

import supabase

logger = logging.getLogger(__name__)
print(logger.hasHandlers())
print(logger.handlers)

root_logger = logging.getLogger()
print(root_logger.handlers)
% pip list | grep supabase
supabase                  2.4.6

% python temp.py
True
[]
[<StreamHandler <stderr> (NOTSET)>]

@silentworks silentworks reopened this May 23, 2024
@silentworks
Copy link
Contributor

@oniatsu I'm getting completely different results to you with the latest 2.4.6 release.

image

@oniatsu
Copy link
Author

oniatsu commented May 23, 2024

@silentworks I ran it again in a re-created venv environment and the results were the same as yours.
It may have been my environment. My apologies.
I will close it as it is probably not the problem.

@oniatsu oniatsu closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants