Remove obnoxious log message when Healthchecks hook sends failure for check action.

This commit is contained in:
Dan Helfman 2019-11-17 18:55:40 -08:00
parent 50f62d73b7
commit d99e6d1994
2 changed files with 4 additions and 5 deletions

View file

@ -53,9 +53,8 @@ def format_buffered_logs_for_payload():
if isinstance(handler, Forgetful_buffering_handler)
)
except StopIteration:
payload = 'Cannot find the log handler for sending logs to Healthchecks'
logger.warning(payload)
return payload
# No handler means no payload.
return ''
payload = ''.join(message for message in buffering_handler.buffer)

View file

@ -46,14 +46,14 @@ def test_format_buffered_logs_for_payload_inserts_truncation_indicator_when_logs
assert payload == '...\nfoo\nbar\n'
def test_format_buffered_logs_for_payload_without_handler_produces_payload_anyway():
def test_format_buffered_logs_for_payload_without_handler_produces_empty_payload():
flexmock(module.logging).should_receive('getLogger').and_return(
flexmock(handlers=[module.logging.Handler()])
)
payload = module.format_buffered_logs_for_payload()
assert payload
assert payload == ''
def test_ping_monitor_hits_ping_url_for_start_state():