extended logging #180

Merged
tech merged 1 commits from log-180 into main 2025-12-25 21:04:20 +00:00
3 changed files with 8 additions and 2 deletions

View File

@@ -402,12 +402,12 @@ func SubmitTransfer(ctx context.Context, deps driver.Deps, network shared.Networ
client, err := registry.Client(network.Name)
if err != nil {
logger.Warn("Failed to initialise rpc client", zap.Error(err), zap.String("network", network.Name))
logger.Warn("Failed to initialise RPC client", zap.Error(err), zap.String("network", network.Name))
return "", err
}
rpcClient, err := registry.RPCClient(network.Name)
if err != nil {
logger.Warn("failed to initialise rpc client", zap.String("network", network.Name))
logger.Warn("Failed to initialise RPC client", zap.String("network", network.Name))
return "", err
}

View File

@@ -151,6 +151,10 @@ func (d *Driver) EstimateFee(ctx context.Context, deps driver.Deps, network shar
d.logger.Warn("Estimate fee failed", zap.Error(err),
zap.String("wallet_ref", wallet.WalletRef),
zap.String("network", network.Name),
zap.String("from_address", wallet.DepositAddress),
zap.String("from_rpc", rpcFrom),
zap.String("to_address", destination),
zap.String("to_rpc", rpcTo),
)
} else if result != nil {
d.logger.Debug("Estimate fee result",

View File

@@ -183,6 +183,8 @@ func (l *loggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, erro
}
if resp.StatusCode >= 400 {
l.logger.Warn("RPC response error", respFields...)
} else if len(bodyBytes) == 0 {
l.logger.Warn("RPC response empty body", respFields...)
} else if len(bodyBytes) > 0 && !json.Valid(bodyBytes) {
l.logger.Warn("RPC response invalid JSON", respFields...)
}