Commit 869620bb authored by Petr Jediný's avatar Petr Jediný Committed by Rob Pike

log: expose Writer() method of the standard logger

The Go 1.12 introduced Writer() method for logger objects, but
it was not exposed as log package function for standard logger.
This commit adds such Writer() function.

Change-Id: Ia81b1524839fe05c152ecb5eaef047a076349fea
GitHub-Last-Rev: dc152ea641dd928178dbd921e2d0f6361661a0d6
GitHub-Pull-Request: golang/go#31009
Reviewed-on: https://go-review.googlesource.com/c/go/+/168920
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent c7bb4533
......@@ -288,6 +288,11 @@ func SetPrefix(prefix string) {
std.SetPrefix(prefix)
}
// Writer returns the output destination for the standard logger.
func Writer() io.Writer {
return std.Writer()
}
// These functions write to the standard logger.
// Print calls Output to print to the standard logger.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment