2020-11-23 11:51:02 +00:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
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.
|
2021-06-22 15:22:40 +00:00
|
|
|
func LogServiceError(l *logger.Logger, req string, node network.AddressGroup, err error) {
|
2023-04-12 14:35:10 +00:00
|
|
|
l.Error(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),
|
|
|
|
zap.String("error", err.Error()),
|
|
|
|
)
|
|
|
|
}
|
2020-11-23 12:23:32 +00:00
|
|
|
|
|
|
|
// LogWorkerPoolError writes debug error message of object worker pool to provided logger.
|
|
|
|
func LogWorkerPoolError(l *logger.Logger, req string, err error) {
|
2023-04-12 14:35:10 +00:00
|
|
|
l.Error(logs.UtilCouldNotPushTaskToWorkerPool,
|
2020-11-23 12:23:32 +00:00
|
|
|
zap.String("request", req),
|
|
|
|
zap.String("error", err.Error()),
|
|
|
|
)
|
|
|
|
}
|