-
-
Notifications
You must be signed in to change notification settings - Fork 28
Add logging functions to support third party apps #172
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
Conversation
|
troi/content_resolver/subsonic.py
Outdated
logging.addLevelName(APP_LOG_LEVEL_NUM, "NOTICE") | ||
|
||
def applog(message, *args, **kwargs): | ||
if logger.isEnabledFor(APP_LOG_LEVEL_NUM): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should need the manual isEnabledFor, the logger module will check it internally. Also for the next line, why not use log
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log throws argument conversion errors, so sticking with _log, which works.
Right now all output about scanning a subsonic collection goes to stdout, which is worthless for a web app like lb-local. Naming the logger and adding a new logging level that this output goes to allows third parties to tap into better logging facilities in troi.