mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-29 01:37:28 +01:00
Merge pull request #344 from python-telegram-bot/silence-webhook-logging
Move webhook handler logs to logging at DEBUG level
This commit is contained in:
commit
f0b2028e3f
1 changed files with 16 additions and 0 deletions
|
@ -102,3 +102,19 @@ class WebhookHandler(BaseHTTPServer.BaseHTTPRequestHandler, object):
|
||||||
if clen < 0:
|
if clen < 0:
|
||||||
raise _InvalidPost(403)
|
raise _InvalidPost(403)
|
||||||
return clen
|
return clen
|
||||||
|
|
||||||
|
def log_message(self, format, *args):
|
||||||
|
"""Log an arbitrary message.
|
||||||
|
|
||||||
|
This is used by all other logging functions.
|
||||||
|
|
||||||
|
It overrides ``BaseHTTPRequestHandler.log_message``, which logs to ``sys.stderr``.
|
||||||
|
|
||||||
|
The first argument, FORMAT, is a format string for the message to be logged. If the format
|
||||||
|
string contains any % escapes requiring parameters, they should be specified as subsequent
|
||||||
|
arguments (it's just like printf!).
|
||||||
|
|
||||||
|
The client ip is prefixed to every message.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.logger.debug("%s - - %s" % (self.address_string(), format % args))
|
||||||
|
|
Loading…
Add table
Reference in a new issue