Skip to content

Commit f0b2028

Browse files
authored
Merge pull request python-telegram-bot#344 from python-telegram-bot/silence-webhook-logging
Move webhook handler logs to logging at DEBUG level
2 parents b76337d + f443003 commit f0b2028

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

telegram/utils/webhookhandler.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,19 @@ def _get_content_len(self):
102102
if clen < 0:
103103
raise _InvalidPost(403)
104104
return clen
105+
106+
def log_message(self, format, *args):
107+
"""Log an arbitrary message.
108+
109+
This is used by all other logging functions.
110+
111+
It overrides ``BaseHTTPRequestHandler.log_message``, which logs to ``sys.stderr``.
112+
113+
The first argument, FORMAT, is a format string for the message to be logged. If the format
114+
string contains any % escapes requiring parameters, they should be specified as subsequent
115+
arguments (it's just like printf!).
116+
117+
The client ip is prefixed to every message.
118+
"""
119+
120+
self.logger.debug("%s - - %s" % (self.address_string(), format % args))

0 commit comments

Comments
 (0)