You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to ask, why do you need levelWriterAdapter, that implements LevelWriter, if it WriteLevel just calls the Writeio.Writer method with no level usage?
And the second question, don't you think, that in MultiLevelWriter() function it is better to create lwriters with initial length == len(writers)), just like this: lwriters := make([]LevelWriter, len(writers)) and then add elements by index?
Thank you for your package, it is really nice
The text was updated successfully, but these errors were encountered:
New want an io.Writer but if the writer does also implement LevelWriter I use it. The levelWriterAdapter is used here to unify all writers and save a type assertion/condition on each write.
The make([]T, 0, len) with append is equivalent to make([]T, len) with index performance-wise and I prefer the style of the former.
Hello,
I wanted to ask, why do you need
levelWriterAdapter
, that implementsLevelWriter
, if itWriteLevel
just calls theWrite
io.Writer
method with nolevel
usage?And the second question, don't you think, that in
MultiLevelWriter()
function it is better to createlwriters
with initial length ==len(writers))
, just like this:lwriters := make([]LevelWriter, len(writers))
and then add elements by index?Thank you for your package, it is really nice
The text was updated successfully, but these errors were encountered: