| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov ReportAll modified and coverable lines are covered by tests ✅ Additional details and impacted files @@ Coverage Diff @@
## main #1272 +/- ##
=======================================
Coverage 90.96% 90.96%
=======================================
Files 222 222
Lines 7501 7501
=======================================
Hits 6823 6823
Misses 678 678 ☔ View full report in Codecov by Sentry.
|
Sorry, something went wrong.
There was a problem hiding this comment.
🤔 QQ: Do we want to change the slack_sdk logger if no logger is provided to slack_bolt?
Before these changes I found API requests logged as so:
DEBUG:slack_sdk.web.base_client:Sending a request - url: https://slack.com/api/views.publish
But with the default setup this is changed to:
DEBUG:slack_bolt.App:Sending a request - url: https://slack.com/api/views.publish
I think both cases make sense, but I might be used to having the default slack_sdk logs shown here 📣
Sorry, something went wrong.
| assert response.body == "" | ||
| assert_auth_test_count(self, 1) | ||
|
|
||
| def test_custom_web_client_logger_is_used_instead_of_bolt_app_logger(self): |
There was a problem hiding this comment.
👏 Awesome checks!
Sorry, something went wrong.
There was a problem hiding this comment.
A bit more testing is showing that a custom logger setup with the following outputs as expected 🚀
bolt = logging.getLogger("zaps")
logs.setLevel(logging.DEBUG)
app = App(logger=logs, token=os.environ.get("SLACK_BOT_TOKEN"))DEBUG:zaps:Sending a request - url: https://slack.com/api/views.publish
Even fun combinations of logger setups are logging to the right outputs:
bolt = logging.getLogger("zaps")
bolt.setLevel(logging.DEBUG)
webapi = logging.getLogger("zips")
webapi.setLevel(logging.DEBUG)
app = App(logger=bolt, client=WebClient(token=os.environ.get("SLACK_BOT_TOKEN"), logger=webapi))LGTM if the comment beforehand seems right to you, but I'm open to more discussion whenever!
Sorry, something went wrong.
|
🏷️ Small nit to the milestone used, we could add this PR to 1.23.0 and include the changes that landed for 1.22.1 with this next release? |
Sorry, something went wrong.
|
🤔 QQ: Do we want to change the slack_sdk logger if no logger is provided to slack_bolt? This is a good point to bring up, from my investigation before #714 the default slack_bolt logger was being injected as the slack_sdk logger, the default logger of the parent client in the app is the bolt framework logger. bolt-python/slack_bolt/app/app.py Line 242 in 4c237fe |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This aims to resolve #1255
#246 defined passing the Bolt logger as the default logger for WebClient instantiation. Since #714 Bolt creates a new WebClient for each request handling execution, this is to prevent using the singleton pattern.
These changes aim to honor both previous decisions by passing the app client logger into each WebClient created for request handling.
Testing
Default WebClient logger is the Bolt App logger
Custom logger can be set on WebClient
Category
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.