[#240] logs: Factor out common service log messages

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-04-13 15:51:36 +03:00 committed by fyrchik
parent 0e31c12e63
commit cffcc7745e
15 changed files with 53 additions and 64 deletions

View file

@ -12,7 +12,7 @@ import (
func (np *Processor) handleDeposit(ev event.Event) {
deposit := ev.(frostfsEvent.Deposit)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "deposit"),
zap.String("id", hex.EncodeToString(slice.CopyReverse(deposit.ID()))))
@ -28,7 +28,7 @@ func (np *Processor) handleDeposit(ev event.Event) {
func (np *Processor) handleWithdraw(ev event.Event) {
withdraw := ev.(frostfsEvent.Withdraw)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "withdraw"),
zap.String("id", hex.EncodeToString(slice.CopyReverse(withdraw.ID()))))
@ -44,7 +44,7 @@ func (np *Processor) handleWithdraw(ev event.Event) {
func (np *Processor) handleCheque(ev event.Event) {
cheque := ev.(frostfsEvent.Cheque)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "cheque"),
zap.String("id", hex.EncodeToString(cheque.ID())))
@ -60,7 +60,7 @@ func (np *Processor) handleCheque(ev event.Event) {
func (np *Processor) handleConfig(ev event.Event) {
cfg := ev.(frostfsEvent.Config)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "set config"),
zap.String("key", hex.EncodeToString(cfg.Key())),
zap.String("value", hex.EncodeToString(cfg.Value())))
@ -77,7 +77,7 @@ func (np *Processor) handleConfig(ev event.Event) {
func (np *Processor) handleBind(ev event.Event) {
e := ev.(frostfsEvent.Bind)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "bind"),
)
@ -93,7 +93,7 @@ func (np *Processor) handleBind(ev event.Event) {
func (np *Processor) handleUnbind(ev event.Event) {
e := ev.(frostfsEvent.Unbind)
np.log.Info(logs.FrostFSNotification,
np.log.Info(logs.Notification,
zap.String("type", "unbind"),
)