Commit 86fdcbed authored by Rob Pike's avatar Rob Pike

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/2686Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent fcff3ba7
......@@ -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.
}
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