Fields returns structured log fields for the chat identity on ctx.
(ctx context.Context)
| 42 | |
| 43 | // Fields returns structured log fields for the chat identity on ctx. |
| 44 | func Fields(ctx context.Context) []slog.Field { |
| 45 | chatCtx, ok := FromContext(ctx) |
| 46 | if !ok { |
| 47 | return nil |
| 48 | } |
| 49 | return chatFields(chatCtx.ID, chatCtx.AncestorIDs) |
| 50 | } |
| 51 | |
| 52 | // Middleware tags agent logs for requests that originate from |
| 53 | // chatd. Agent log lines emitted while serving a request with Coder-Chat-Id, |