Skip to content

Commit

Permalink
Merge pull request #1 from akarmarkar/master
Browse files Browse the repository at this point in the history
Summary: Add InfofWithFileLine method to log with a give file and line
  • Loading branch information
hkoehler authored May 11, 2017
2 parents e32b306 + f90d0d5 commit c360512
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions glog.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,14 @@ func (v Verbose) Infof(format string, args ...interface{}) {
}
}

// InfofWithFileLine is equivalent to the global Infof function, but uses
// the given file and line number.
func (v Verbose) InfofWithFileLine(file string, line int, format string, args ...interface{}) {
if v {
logging.printWithFileLine(infoLog, file, line, true, fmt.Sprintf(format, args...))
}
}

// Info logs to the INFO log.
// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.
func Info(args ...interface{}) {
Expand Down

0 comments on commit c360512

Please sign in to comment.