Sprintf returns a log entry that is formatted using fmt.Sprintf just before writing to the output. This is more desirable than using fmt.Sprintf from the caller's end because the cost of formatting can be avoided if the log is filtered, for example, by log level.
(format string, args ...interface{})
| 17 | // caller's end because the cost of formatting can be avoided if the log is |
| 18 | // filtered, for example, by log level. |
| 19 | func Sprintf(format string, args ...interface{}) fmt.Stringer { |
| 20 | return sprintf{format: format, args: args} |
| 21 | } |
| 22 | |
| 23 | type sprint struct { |
| 24 | args []interface{} |
no outgoing calls