diff options
author | Rob Pike <r@golang.org> | 2015-01-12 14:30:10 +1100 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2015-01-12 04:45:38 +0000 |
commit | 86fdcbedbcb868f7f2e8274d2b50f0ea34043c47 (patch) | |
tree | 99ce60b45ef80b2c6105c550393fa8434ae42651 /src/log | |
parent | fcff3ba740ed6638cece4dea8478bd1dfb2411bf (diff) | |
download | go-86fdcbedbcb868f7f2e8274d2b50f0ea34043c47.tar.gz go-86fdcbedbcb868f7f2e8274d2b50f0ea34043c47.zip |
log: add global Output function
It was just an oversight that this one method of Logger was not
made available for the standard (std) Logger.
Fixes #9183
Change-Id: I2f251becdb0bae459212d09ea0e5e88774d16dea
Reviewed-on: https://go-review.googlesource.com/2686
Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/log')
-rw-r--r-- | src/log/log.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/log/log.go b/src/log/log.go index 5ff2bc21e3..0ef05d8f94 100644 --- a/src/log/log.go +++ b/src/log/log.go @@ -322,3 +322,14 @@ func Panicln(v ...interface{}) { std.Output(2, s) panic(s) } + +// Output writes the output for a logging event. The string s contains +// the text to print after the prefix specified by the flags of the +// Logger. A newline is appended if the last character of s is not +// already a newline. Calldepth is the count of the number of +// frames to skip when computing the file name and line number +// if Llongfile or Lshortfile is set; a value of 1 will print the details +// for the caller of Output. +func Output(calldepth int, s string) error { + return std.Output(calldepth+1, s) // +1 for this frame. +} |