Skip to content

Commit

Permalink
bugfix for logging level
Browse files Browse the repository at this point in the history
  • Loading branch information
avarsava committed Jul 8, 2024
1 parent 9272485 commit 4f471f3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ protected synchronized Optional<Integer> update(Configuration configuration) {
public synchronized void writeLog(
String message, LogLevel level, Map<String, String> attributes) {
final var now = Instant.now();
buffer.computeIfAbsent(attributes, k -> new ArrayList<>()).add(new Pair<>(now, message));
if (level.compareTo(this.configuration.get().getLevel()) >= 0) flush(now);
if (level.compareTo(this.configuration.get().getLevel()) >= 0)
buffer.computeIfAbsent(attributes, k -> new ArrayList<>()).add(new Pair<>(now, message));
flush(now);
}
}

0 comments on commit 4f471f3

Please sign in to comment.