Skip to content

Commit

Permalink
improve debug message
Browse files Browse the repository at this point in the history
Signed-off-by: Daijiro Fukuda <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>
  • Loading branch information
daipom and ashie committed Jul 8, 2024
1 parent fdf74e5 commit 955cee5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,11 @@ def read_lines(lines)

if is_long_line
@log.warn "received line length is longer than #{@max_line_size}"
@log.debug("skipped line: ") { convert(rbuf).chomp }
if @skip_current_line
@log.debug("The continuing line is finished. Finally discarded data: ") { convert(rbuf).chomp }
else
@log.debug("skipped line: ") { convert(rbuf).chomp }
end
has_skipped_line = true
@skip_current_line = false
@skipping_current_line_bytesize = 0
Expand All @@ -1079,6 +1083,11 @@ def read_lines(lines)
)

if is_long_current_line
@log.debug(
"The continuing current line length is longer than #{@max_line_size}." +
" The received data will be discarded until this line is finished." +
" Discarded data: "
) { convert(@buffer).chomp }
@skip_current_line = true
@skipping_current_line_bytesize += @buffer.bytesize
@buffer.clear
Expand Down

0 comments on commit 955cee5

Please sign in to comment.