mirror of
https://github.com/golang/go
synced 2024-11-23 05:20:11 -07:00
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: dc152ea641
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: Rob Pike <r@golang.org>
This commit is contained in:
parent
c7bb4533cb
commit
869620bbea
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user