Closed javierdelapuente closed 6 months ago
Thanks for the report.
Yes, it does seem a bit brutal to error out and fail in this case. It should at least try/truncate/skip (and print a warning?). The error is from the ReadSlice
call in client/logs.go
returning bufio.ErrBufferFull
, so we'll need to handle that case specially (for comparison, the bufio.ErrBufferFull
case is handled specially in servicelog.Parser
).
When running
pebble logs
, when there is a line with a log over 4KiB, it fails with the error (and does not show next lines):This is easily reproducible with a plan like this one:
Although long, this line size is not uncommon for a log. https://github.com/canonical/pebble/blob/95b73bb24eafa386ad4924abb57ffae9b5ef4501/client/logs.go#L30
An alternative to a bigger constant could be to print up to a fixed number of characters and skip the rest of the line.