Skip to content

Commit

Permalink
Add string formatting in LogStream
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtoLord committed Nov 9, 2023
1 parent 5e7c707 commit d5353d4
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ public void run() {

if (inputHandle.string() != null) {
try {
writeLines(inputHandle.string().getBytes());
var s = inputHandle.string();
var formatter = inputHandle.formatter();

if (formatter != null) {
for (var line : s.split("\n")) {
writeLines(formatter.apply(line).getBytes());
}
} else {
writeLines(inputHandle.string().getBytes());
}
} catch (IOException e) {
LogStream.LOG.warn("Cannot write buffer to stream {}: ", streamName, e);
}
Expand Down

0 comments on commit d5353d4

Please sign in to comment.