RealtimeSTT
RealtimeSTT copied to clipboard
Using named logger instead of root logger
Close: #183
Try to avoid breaking the existing config options, for providing a default useful settings for user.
Outputs:
Then you can config the logger in your app:
# change the global log format
logger = logging.getLogger()
# add a console handler, like what realtimestt did in the __init__
formatter = logging.Formatter(fmt="xxxxx")
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
console_handler.setFormatter(formatter)
logger.addHandler(console_handler)
# you can also output all logs from your app to a file
# you can also config the logs from realtimestt or other libs
logger = logging.getLogger("realtimestt")
# e.g. change the log level
logger.setLevel(logging.WARNING)
....