supabase-py icon indicating copy to clipboard operation
supabase-py copied to clipboard

The root logger has been used illegally.

Open oniatsu opened this issue 1 year ago • 0 comments

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 avatar Mar 28 '24 03:03 oniatsu