| 125 | } |
| 126 | |
| 127 | func (g *loggerT) output(severity int, s string) { |
| 128 | sevStr := severityName[severity] |
| 129 | if !g.jsonFormat { |
| 130 | g.m[severity].Output(2, sevStr+": "+s) |
| 131 | return |
| 132 | } |
| 133 | // TODO: we can also include the logging component, but that needs more |
| 134 | // (API) changes. |
| 135 | b, _ := json.Marshal(map[string]string{ |
| 136 | "severity": sevStr, |
| 137 | "message": s, |
| 138 | }) |
| 139 | g.m[severity].Output(2, string(b)) |
| 140 | } |
| 141 | |
| 142 | func (g *loggerT) printf(severity int, format string, args ...any) { |
| 143 | // Note the discard check is duplicated in each print func, rather than in |