Skip to content

Commit

Permalink
fix(cloud): Quiet the HTTP server log (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish authored Oct 24, 2024
1 parent 1231502 commit 4170d21
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions streamer/proxy_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ def __init__(self, rate_limiter: RateLimiter, *args, **kwargs):
# members never get set.
super().__init__(*args, **kwargs)

# NOTE: The default values here for log_request are taken from the base
# class, and not a design decision of ours.
def log_request(self, code: str = '-', size: str = '-') -> None:
"""Override the request logging feature of the Python HTTP server."""
try:
code_int = int(code)
except:
code_int = 0

if code_int >= 200 and code_int <= 299:
# Stub out log_request to avoid creating noise from the HTTP server when
# requests are successful.
return

return super().log_request(code, size)

def do_PUT(self) -> None:
"""Handle the PUT requests coming from Shaka Packager."""

Expand Down

0 comments on commit 4170d21

Please sign in to comment.