You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
The module I am writing logs INFO logs to std.out. logger.py in depthai_sdk overrides my own logger config and writes INFO logs to std.err.
Proposed Solution
Please refactor the logging logic in the Python SDK to use a custom logger object rather than using basicConfig and modifying the root logger for the entire logging package. This way if users want to modify the depthai logging config they can do so by using getLogger rather than messing with logging globally.
# example
# Create a logger for your module, using the module's name
logger = logging.getLogger(__name__)
# Configure the logger for your module
logger.setLevel(logging.INFO) # Set the desired log level
handler = logging.StreamHandler() # Add a handler (e.g., to the console)
formatter = logging.Formatter('[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
The text was updated successfully, but these errors were encountered:
Problem
The module I am writing logs INFO logs to std.out.
logger.py
in depthai_sdk overrides my own logger config and writes INFO logs to std.err.Proposed Solution
Please refactor the logging logic in the Python SDK to use a custom logger object rather than using
basicConfig
and modifying the root logger for the entire logging package. This way if users want to modify the depthai logging config they can do so by usinggetLogger
rather than messing with logging globally.The text was updated successfully, but these errors were encountered: