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

How to config user logging? #183

Open
yp05327 opened this issue Jan 21, 2025 · 3 comments · May be fixed by #187
Open

How to config user logging? #183

yp05327 opened this issue Jan 21, 2025 · 3 comments · May be fixed by #187

Comments

@yp05327
Copy link

yp05327 commented Jan 21, 2025

When I use this lib, I found that I can not use logging to output any logs, and all output logs are formated with the prefix of RealTimeSTT:

@yp05327
Copy link
Author

yp05327 commented Jan 21, 2025

After check the code, it is using root logger.
I think this can be impove to: init a unique logger named RealtimeSTT, and use this logger to output logs, then user can easily control the output.

@KoljaB
Copy link
Owner

KoljaB commented Jan 23, 2025

Good catch! I'm not very familiar with logging myself, would you be up for sending in a PR to improve this?

@yp05327
Copy link
Author

yp05327 commented Jan 24, 2025

It is very simple:

# define a named logger
logger = logging.getLogger("realtimestt")
# config it (optional)

Then replace all logging into logger.

There are some custom settings to the logger in realtimestt, I'm not sure what it is used for.
I'm not very familiar with logging myself too, so I checked the usage of logging in other libs I'm using, it seems that they won't do custom setting to their named logger, just define it and then use.
Maybe it is not necessary, user can get it, and set it by themselves.

Actually, I have forked and planed to fix it. But IMO, these custom settings can be removed, I will check it later.

@yp05327 yp05327 linked a pull request Jan 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants