2020-11-23 11:51:02 +00:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
2024-10-21 07:22:54 +00:00
|
|
|
"context"
|
|
|
|
|
2023-04-12 14:35:10 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
2020-11-23 11:51:02 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2022-12-30 10:31:59 +00:00
|
|
|
// LogServiceError writes error message of object service to provided logger.
|
2024-10-21 13:27:28 +00:00
|
|
|
func LogServiceError(ctx context.Context, l *logger.Logger, req string, node network.AddressGroup, err error) {
|
|
|
|
l.Error(ctx, logs.UtilObjectServiceError,
|
2021-06-22 15:22:40 +00:00
|
|
|
zap.String("node", network.StringifyGroup(node)),
|
2020-11-23 11:51:02 +00:00
|
|
|
zap.String("request", req),
|
2024-12-13 08:44:56 +00:00
|
|
|
zap.Error(err),
|
2020-11-23 11:51:02 +00:00
|
|
|
)
|
|
|
|
}
|
2020-11-23 12:23:32 +00:00
|
|
|
|
|
|
|
// LogWorkerPoolError writes debug error message of object worker pool to provided logger.
|
2024-10-21 13:27:28 +00:00
|
|
|
func LogWorkerPoolError(ctx context.Context, l *logger.Logger, req string, err error) {
|
|
|
|
l.Error(ctx, logs.UtilCouldNotPushTaskToWorkerPool,
|
2020-11-23 12:23:32 +00:00
|
|
|
zap.String("request", req),
|
2024-12-13 08:44:56 +00:00
|
|
|
zap.Error(err),
|
2020-11-23 12:23:32 +00:00
|
|
|
)
|
|
|
|
}
|