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

Function AddTraceEvent

internal/channelz/trace.go:195–213  ·  internal/channelz/trace.go::AddTraceEvent

AddTraceEvent adds trace related to the entity with specified id, using the provided TraceEventDesc. If channelz is not turned ON, this will simply log the event descriptions.

(l grpclog.DepthLoggerV2, e Entity, depth int, desc *TraceEvent)

Source from the content-addressed store, hash-verified

193//
194// If channelz is not turned ON, this will simply log the event descriptions.
195func AddTraceEvent(l grpclog.DepthLoggerV2, e Entity, depth int, desc *TraceEvent) {
196 // Log only the trace description associated with the bottom most entity.
197 d := fmt.Sprintf("[%s] %s", e, desc.Desc)
198 switch desc.Severity {
199 case CtUnknown, CtInfo:
200 l.InfoDepth(depth+1, d)
201 case CtWarning:
202 l.WarningDepth(depth+1, d)
203 case CtError:
204 l.ErrorDepth(depth+1, d)
205 }
206
207 if getMaxTraceEntry() == 0 {
208 return
209 }
210 if IsOn() {
211 db.traceEvent(e.id(), desc)
212 }
213}

Callers 11

addTraceEventMethod · 0.92
newAddrConnLockedMethod · 0.92
tearDownMethod · 0.92
TestGetChannelMethod · 0.92
TestGetSubChannelMethod · 0.92
InfoFunction · 0.85
InfofFunction · 0.85
WarningFunction · 0.85
WarningfFunction · 0.85
ErrorFunction · 0.85
ErrorfFunction · 0.85

Calls 7

getMaxTraceEntryFunction · 0.85
IsOnFunction · 0.85
traceEventMethod · 0.80
InfoDepthMethod · 0.65
WarningDepthMethod · 0.65
ErrorDepthMethod · 0.65
idMethod · 0.65

Tested by 2

TestGetChannelMethod · 0.74
TestGetSubChannelMethod · 0.74