diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-25 20:31:23 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-25 20:31:23 +0000 |
commit | a59ee560978159013ade1bfb878d39cf9c551476 (patch) | |
tree | 90f51e64cb9943fa8b06416467bb173b6336fb24 /pkg/log/glog.go | |
parent | f01e5389f8edfb79df55b8fef1e8bf5a30a93fb7 (diff) | |
parent | 6def8ea6ac601daa9256a31f818db9f7eb532168 (diff) |
Merge release-20200219.0-36-g6def8ea (automated)
Diffstat (limited to 'pkg/log/glog.go')
-rw-r--r-- | pkg/log/glog.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/log/glog.go b/pkg/log/glog.go index cab5fae55..b4f7bb5a4 100644 --- a/pkg/log/glog.go +++ b/pkg/log/glog.go @@ -46,7 +46,7 @@ var pid = os.Getpid() // line The line number // msg The user-supplied message // -func (g *GoogleEmitter) Emit(level Level, timestamp time.Time, format string, args ...interface{}) { +func (g *GoogleEmitter) Emit(depth int, level Level, timestamp time.Time, format string, args ...interface{}) { // Log level. prefix := byte('?') switch level { @@ -64,9 +64,7 @@ func (g *GoogleEmitter) Emit(level Level, timestamp time.Time, format string, ar microsecond := int(timestamp.Nanosecond() / 1000) // 0 = this frame. - // 1 = Debugf, etc. - // 2 = Caller. - _, file, line, ok := runtime.Caller(2) + _, file, line, ok := runtime.Caller(depth + 1) if ok { // Trim any directory path from the file. slash := strings.LastIndexByte(file, byte('/')) |