Log sends an error of "format" and optional "args" to the client and prints that error using the "LogError" package-level function, which can be customized. See "LogErr" too.
(ctx *context.Context, format string, args ...interface{})
| 339 | // |
| 340 | // See "LogErr" too. |
| 341 | func (e ErrorCodeName) Log(ctx *context.Context, format string, args ...interface{}) { |
| 342 | if SkipCanceled { |
| 343 | if ctx.IsCanceled() { |
| 344 | return |
| 345 | } |
| 346 | |
| 347 | for _, arg := range args { |
| 348 | if err, ok := arg.(error); ok { |
| 349 | if context.IsErrCanceled(err) { |
| 350 | return |
| 351 | } |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | err := fmt.Errorf(format, args...) |
| 357 | e.LogErr(ctx, err) |
| 358 | } |
| 359 | |
| 360 | // LogErr sends the given "err" as message to the client and prints that |
| 361 | // error to using the "LogError" package-level function, which can be customized. |
nothing calls this directly
no test coverage detected