chore: project refactor

This commit is contained in:
ITQ
2025-11-13 16:09:56 +03:00
parent f93bcaea03
commit c3def9dc26
13 changed files with 167 additions and 68 deletions
+5 -5
View File
@@ -32,13 +32,13 @@ func (i *LoggerInterceptor) Unary() grpc.UnaryServerInterceptor {
if err != nil {
if st, ok := status.FromError(err); ok {
log.Printf("Error: %s, Code: %s, Duration: %v",
log.Printf("error: %s, code: %s, duration: %v",
st.Message(), st.Code(), duration)
} else {
log.Printf("Error: %v, Duration: %v", err, duration)
log.Printf("error: %v, duration: %v", err, duration)
}
} else {
log.Printf("Method %s completed in %v", info.FullMethod, duration)
log.Printf("method %s completed in %v", info.FullMethod, duration)
}
return resp, err
@@ -61,10 +61,10 @@ func (i *LoggerInterceptor) Stream() grpc.StreamServerInterceptor {
duration := time.Since(start)
if err != nil {
log.Printf("Stream method %s failed: %v, Duration: %v",
log.Printf("stream method %s failed: %v, duration: %v",
info.FullMethod, err, duration)
} else {
log.Printf("Stream method %s completed in %v",
log.Printf("stream method %s completed in %v",
info.FullMethod, duration)
}