mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-03 08:35:59 +08:00
log
This commit is contained in:
@@ -242,13 +242,11 @@ func ShowLog(ctx context.Context) {
|
||||
OperationID := trace_log.GetOperationID(ctx)
|
||||
if ctx.Value(trace_log.TraceLogKey).(*trace_log.ApiInfo).GinCtx != nil {
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": ctxLogger.Type,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
}).Infoln("api: ", t.ApiName)
|
||||
} else {
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": ctxLogger.Type,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
}).Infoln("rpc: ", t.ApiName)
|
||||
@@ -256,7 +254,6 @@ func ShowLog(ctx context.Context) {
|
||||
for _, v := range *t.Funcs {
|
||||
if v.Err != nil {
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": v.File,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
"FilePath": v.File,
|
||||
@@ -265,21 +262,18 @@ func ShowLog(ctx context.Context) {
|
||||
switch v.LogLevel {
|
||||
case logrus.InfoLevel:
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": v.File,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
"FilePath": v.File,
|
||||
}).Infoln("func: ", v.FuncName, " args: ", v.Args)
|
||||
case logrus.DebugLevel:
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": v.File,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
"FilePath": v.File,
|
||||
}).Debugln("func: ", v.FuncName, " args: ", v.Args)
|
||||
case logrus.WarnLevel:
|
||||
ctxLogger.WithFields(logrus.Fields{
|
||||
"Type": v.File,
|
||||
"OperationID": OperationID,
|
||||
"PID": ctxLogger.Pid,
|
||||
"FilePath": v.File,
|
||||
|
||||
Reference in New Issue
Block a user