(level Level, calldepth int, rec *Record)
| 82 | } |
| 83 | |
| 84 | func (b *LogBackend) Log(level Level, calldepth int, rec *Record) error { |
| 85 | if b.Color && b.f != nil { |
| 86 | buf := &bytes.Buffer{} |
| 87 | setConsoleTextAttribute(b.f, colors[level]) |
| 88 | buf.Write([]byte(rec.Formatted(calldepth + 1))) |
| 89 | err := b.Logger.Output(calldepth+2, buf.String()) |
| 90 | setConsoleTextAttribute(b.f, fgWhite) |
| 91 | return err |
| 92 | } |
| 93 | return b.Logger.Output(calldepth+2, rec.Formatted(calldepth+1)) |
| 94 | } |
| 95 | |
| 96 | // setConsoleTextAttribute sets the attributes of characters written to the |
| 97 | // console screen buffer by the WriteFile or WriteConsole function. |
nothing calls this directly
no test coverage detected