Closed surong-bel closed 1 year ago
@heimrych please take a look. Thanks
Why not just configure the log settings via https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library?
@jogo thanks. We'd like to keep the granularity of different level of logs. That is: slack_sdk related will be kept as DEBUG and slackminion related will be kept as INFO.
This is for the usage when we use another tool (SREbot) to import Slackminion as a dependency. And we can simply specify logger level (in SREbot) to get different level of logs. Our use cases will be 1) SREbot in test mode: print slack_sdk and Slackminion logs and 2) SREbot in prod mode: only print Slackminion logs.
Since Slackminion will be a dependent, does it make sense to not configure logger level for Slackminion's dependency slack_sdk ?
LGTM! Unfortunately, I don't have permission to approve this as well, can @jogo help with this? If there are any doubts regarding why this is for, just let me know here or via Slack as well.
discussed offline, and the are actually debug logs so they should be left as debug and instead control the log levels being recorded via the standard python tooling around this.
I think it's fine leaving as debug, however, we should include the logging of the payload (even as debug) in the dispatcher.push function (since it's where commands are identified apart the rest of regular Slack messages). Logging ALL messages sent to Slack really pollutes the logs, even for debug standards.
Abandon this PR per discussion offline.
Background: Slackminion calls slack_sdk. Within slack_sdk, DEBUG logger level contains raw json responses which are not always relevant with the command usage. Our goal is to simplify Slackminion logs and make it easy for debugging. This PR increases all relevant logs' logger level in Slackminion from DEBUG to INFO, to differentiate with slack_sdk DEBUG level raw json logs.