Skip to content

Fix #430 by adding a new option to customize dev server (http.server) logging - #431

Merged
seratch merged 3 commits into
slackapi:mainfrom
seratch:issue-430-dev-server-logging
Aug 10, 2021
Merged

seratch merged 3 commits into
slackapi:mainfrom
seratch:issue-430-dev-server-logging

Conversation

@seratch

@seratch seratch commented Aug 9, 2021

Copy link
Copy Markdown
Contributor

This pull request fixes #430 by adding a new option http_server_logger_enabled to customize (disable) dev server's default logging, which is not configurable via the standard logging module (as the log_message function writes stderr anyway).

Developers can change the http_server_logger_enabled value in App#start() method arguments. The default value is True.

from slack_bolt import App
app = App()

if __name__ == "__main__":
    app.start(3000, http_server_logger_enabled=False)

AsyncApp runs the AIOHTTP web server, which works with logging module. Thus, we don't need to add the same option to it.

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements (place an x in each [ ])

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@seratch seratch added enhancement New feature or request area:sync labels Aug 9, 2021
@seratch seratch added this to the 1.8.0 milestone Aug 9, 2021
@codecov

codecov Bot commented Aug 9, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #431 (b7a7c00) into main (0692846) will decrease coverage by 0.02%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #431      +/-   ##
==========================================
- Coverage   91.36%   91.33%   -0.03%     
==========================================
  Files         167      167              
  Lines        5491     5496       +5     
==========================================
+ Hits         5017     5020       +3     
- Misses        474      476       +2     
Impacted Files Coverage Δ
slack_bolt/app/app.py 87.55% <71.42%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0692846...b7a7c00. Read the comment docs.

@seratch

seratch commented Aug 10, 2021

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review!

@seratch
seratch merged commit a233837 into slackapi:main Aug 10, 2021
@seratch
seratch deleted the issue-430-dev-server-logging branch August 10, 2021 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sync enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How can I stop the logging of HTTP requests to the app?

2 participants