Skip to content

Commit aa1b87c

Browse files
authored
Update LogRoller.jl (#16)
1 parent a2d9193 commit aa1b87c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LogRoller.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,18 @@ write(io::RollingFileWriter, str::Union{SubString{String}, String}) = _write(io,
9494
write(io::RollingFileWriter, buff::Vector{UInt8}) = _write(io, buff)
9595

9696
function _write(io::RollingFileWriter, args...)
97+
bytes_written = 0
9798
lock(io.lck) do
98-
io.filesize += write(io.stream, args...)
99+
bytes_written += write(io.stream, args...)
100+
io.filesize += bytes_written
99101
flush(io.stream)
100102
if io.filesize >= io.sizelimit
101103
with_logger(NullLogger()) do
102104
rotate_file(io)
103105
end
104106
end
105107
end
108+
return bytes_written
106109
end
107110

108111
"""

0 commit comments

Comments
 (0)