MCPcopy
hub / github.com/grpc/grpc-go / Log

Method Log

authz/audit/stdout/stdout_logger.go:58–68  ·  view source on GitHub ↗

Log marshals the audit.Event to json and prints it to standard output.

(event *audit.Event)

Source from the content-addressed store, hash-verified

56
57// Log marshals the audit.Event to json and prints it to standard output.
58func (l *logger) Log(event *audit.Event) {
59 jsonContainer := map[string]any{
60 "grpc_audit_log": convertEvent(event),
61 }
62 jsonBytes, err := json.Marshal(jsonContainer)
63 if err != nil {
64 grpcLogger.Errorf("failed to marshal AuditEvent data to JSON: %v", err)
65 return
66 }
67 l.goLogger.Println(string(jsonBytes))
68}
69
70// loggerConfig represents the configuration for the stdout logger.
71// It is currently empty and implements the audit.Logger interface by embedding it.

Callers

nothing calls this directly

Calls 4

convertEventFunction · 0.85
PrintlnMethod · 0.80
MarshalMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected