Skip to content

Commit

Permalink
Add debug handler for request
Browse files Browse the repository at this point in the history
Signed-off-by: alex-ak1 <[email protected]>
  • Loading branch information
alex-ak1 committed Jul 26, 2024
1 parent d8d5c08 commit d911ab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus_client/exposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ class TmpServer(ThreadingWSGIServer):

TmpServer.address_family, addr = _get_best_family(addr, port)
app = make_wsgi_app(registry)
handler = _SilentHandler # type: WSGIRequestHandler
if debug:
handler = _PrintHandler
httpd = make_server(addr, port, app, TmpServer, handler_class=handler)
httpd = make_server(addr, port, app, TmpServer, handler_class=_PrintHandler)
else:
httpd = make_server(addr, port, app, TmpServer, handler_class=_SilentHandler)
if certfile and keyfile:
context = _get_ssl_ctx(certfile, keyfile, protocol, client_cafile, client_capath, client_auth_required)
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
Expand Down

0 comments on commit d911ab3

Please sign in to comment.