Skip to content

Commit

Permalink
limit ms logger resolution (#510)
Browse files Browse the repository at this point in the history
* limit ms logger resolution

* skip variable assignment
  • Loading branch information
mensfeld authored Jul 1, 2024
1 parent 04c86d5 commit 60f5e99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# WaterDrop changelog

## 2.7.4 (Unreleased)
- [Maintenance] Lower the precision reporting to 100 microseconds in the logger listener.
- [Change] Require 'karafka-core' `>= 2.4.3`

## 2.7.3 (2024-06-09)
Expand Down
2 changes: 1 addition & 1 deletion lib/waterdrop/instrumentation/logger_listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def debug(event, log_message)
# @param log_message [String] message we want to publish
def info(event, log_message)
if event.payload.key?(:time)
@logger.info("[#{event[:producer_id]}] #{log_message} took #{event[:time]} ms")
@logger.info("[#{event[:producer_id]}] #{log_message} took #{event[:time].round(2)} ms")
else
@logger.info("[#{event[:producer_id]}] #{log_message}")
end
Expand Down

0 comments on commit 60f5e99

Please sign in to comment.