chore: update error logger

This commit is contained in:
Steven 2024-03-03 14:20:59 +08:00
parent c1da87a819
commit e441e3882b

View file

@ -41,4 +41,7 @@ func (*LoggerInterceptor) loggerInterceptorDo(ctx context.Context, fullMethod st
logMsg = "unknown error"
}
slog.LogAttrs(ctx, logLevel, logMsg, slog.String("method", fullMethod))
if err != nil {
slog.LogAttrs(ctx, logLevel, "", slog.String("error", err.Error()))
}
}