From 4cd1efd4464898b2031a469afa2e718639dea753 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 9 Oct 2023 15:58:05 -0500 Subject: [PATCH] update logs --- services/scribe/config/config.go | 2 ++ services/scribe/service/scribe.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/scribe/config/config.go b/services/scribe/config/config.go index 6d059fc501..e8412a96a6 100644 --- a/services/scribe/config/config.go +++ b/services/scribe/config/config.go @@ -16,6 +16,8 @@ type Config struct { Chains ChainConfigs `yaml:"chains"` // RPCURL is the url of the omnirpc. RPCURL string `yaml:"rpc_url"` + // Verbose is used to enable verbose logging. + Verbose bool `yaml:"verbose"` } // IsValid makes sure the config is valid. This is done by calling IsValid() on each diff --git a/services/scribe/service/scribe.go b/services/scribe/service/scribe.go index c19b5ddc97..6a0f442d52 100644 --- a/services/scribe/service/scribe.go +++ b/services/scribe/service/scribe.go @@ -82,14 +82,14 @@ func (s Scribe) Start(ctx context.Context) error { cancelChain() // redundant, but clean. return fmt.Errorf("global scribe context cancel %w", groupCtx.Err()) case <-chainCtx.Done(): // Chain level context cancel, retry and recreate context. - logger.ReportScribeError(fmt.Errorf("chain level scribe context cancel"), chainID, logger.ContextCancelled) + logger.ReportScribeError(fmt.Errorf("chain level scribe context cancel, %w", chainCtx.Err()), chainID, logger.ContextCancelled) chainCtx, cancelChain = context.WithCancel(ctx) retryRate = b.Duration() continue case <-time.After(retryRate): err := s.chainIndexers[chainID].Index(groupCtx) if err != nil { - logger.ReportScribeError(fmt.Errorf("error running chain indexer"), chainID, logger.FatalScribeError) + logger.ReportScribeError(fmt.Errorf("error running chain indexer %w", err), chainID, logger.FatalScribeError) retryRate = b.Duration() continue }