Commit Graph

2 Commits

Author SHA1 Message Date
Paul Holzinger d40e25cd45 fix panic in Writer
Commit 766cfece introduced this bug by defining an incorrect split
function. First it breaks the old behavior because it never splits at
newlines now. Second, it causes a panic because it never tells the
scanner to stop. See the bufio.ScanLines function, something like:
```
if atEOF && len(data) == 0 {
	return 0, nil, nil
}
```
is needed to do that.

This commit fixes it by restoring the old behavior and calling
bufio.ScanLines but also keep the 64KB check in place to avoid buffering
for to long.

Two tests are added to ensure it is working as expected.

Fixes #1383

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-21 08:59:35 -04:00
Edward Muller 6cd8d684fd
some minimal documentation for Logger.Writer{,Level}
This also includes two examples extracted from the readme.
2019-09-05 19:34:46 -07:00