MCPcopy
hub / github.com/Tencent/WeKnora / GetLogger

Function GetLogger

internal/logger/logger.go:268–273  ·  view source on GitHub ↗

GetLogger 获取日志实例

(c context.Context)

Source from the content-addressed store, hash-verified

266
267// GetLogger 获取日志实例
268func GetLogger(c context.Context) *logrus.Entry {
269 if logger := c.Value(types.LoggerContextKey); logger != nil {
270 return logger.(*logrus.Entry)
271 }
272 return logrus.NewEntry(appLogger)
273}
274
275// SetOutput overrides the internal logger's output destination.
276// Intended for use in tests that need to capture and assert on log content

Callers 15

emitMethod · 0.92
loadDBStoresIntoRegistryFunction · 0.92
RequestIDFunction · 0.92
LoggerFunction · 0.92
DeleteKnowledgeMethod · 0.92
DeleteKnowledgeListMethod · 0.92
CreateMCPServiceMethod · 0.92
GetMCPServiceByIDMethod · 0.92
ListMCPServicesMethod · 0.92
ListMCPServicesByIDsMethod · 0.92

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected