2020-11-23 11:51:02 +00:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/network"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/util/logger"
|
2020-11-23 11:51:02 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// LogServiceError writes debug 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) {
|
2020-11-23 11:51:02 +00:00
|
|
|
l.Debug("object service error",
|
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) {
|
|
|
|
l.Debug("could not push task to worker pool",
|
|
|
|
zap.String("request", req),
|
|
|
|
zap.String("error", err.Error()),
|
|
|
|
)
|
|
|
|
}
|