Skip to content

Commit

Permalink
Log "caught up" messages at debug level (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Smith <[email protected]>
  • Loading branch information
tonyvanriet and electricshaman authored Apr 5, 2023
1 parent d1f247b commit 782333d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## UNRELEASED
-->

## 1.1.1 - 2023-04-04

### Changed

- "caught up" messages logged at debug level

## 1.1.0 - 2022-10-12

This change adds the ability to use :global and Registry names for the process
Expand Down
4 changes: 2 additions & 2 deletions lib/beeline/health_checker/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Beeline.HealthChecker.Logger do
end
```
The log messages are 'info' level in a format of the producer name
The log messages are 'debug' level in a format of the producer name
concatenated with "is caught up." if the producer's current stream position
matches the latest available stream position and a 'warn' level message
with "is behind: n events." when the producer is behind, with `n` being
Expand Down Expand Up @@ -53,7 +53,7 @@ defmodule Beeline.HealthChecker.Logger do
log_metadata = [delta: delta, event_listener: producer]

if delta == 0 do
Logger.info("#{producer} is caught up.", log_metadata)
Logger.debug("#{producer} is caught up.", log_metadata)
else
# coveralls-ignore-start
Logger.warn("#{producer} is behind: #{delta} events.", log_metadata)
Expand Down
2 changes: 1 addition & 1 deletion test/beeline/good_handler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ defmodule Beeline.GoodHandlerTest do
)

log =
capture_log([level: :info], fn ->
capture_log([level: :debug], fn ->
start_supervised!(
{GoodHandler,
grpc_stream_name: c.grpc_stream_name,
Expand Down

0 comments on commit 782333d

Please sign in to comment.