Um, exposing the field `out` doesn't help (much) because it's
an io.Writer with no close method anyway. You could, I suppose,
do the type-test dance.
If you're going to tinker with the log output stream anyway,
you could keep track of the file (if it's a file) that you've set it
to and close it directly.
Chris
--
Chris "allusive" Dollin
One of the nice things about the log package is
that it simply wraps an io.Writer. The client
is responsible for setting it up beforehand and
possibly closing it when no longer needed.
Also, remember that the io.Writer interface has
only one method, namely Write. It's possible to
have a type that satisfies this interface yet
has no notion of "closing".
Anthony
> Right. For it, instead of "out io.Writer" should be "out *os.File".
No, it shouldn't. There's no reason to constrain the logging output
to go directly to a file.