From 77c0f046d58c38ca636e2c8b4b78b1941b6acee8 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 6 Jul 2021 15:57:31 -0700 Subject: [PATCH 1/3] Parse debug logs & always emit category --- ingest/ledgerbackend/stellar_core_runner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ingest/ledgerbackend/stellar_core_runner.go b/ingest/ledgerbackend/stellar_core_runner.go index e37ef4058d..68605a60db 100644 --- a/ingest/ledgerbackend/stellar_core_runner.go +++ b/ingest/ledgerbackend/stellar_core_runner.go @@ -218,12 +218,13 @@ func (r *stellarCoreRunner) getLogLineWriter() io.Writer { "ERROR": r.log.Errorf, "WARNING": r.log.Warnf, "INFO": r.log.Infof, + "DEBUG": r.log.Debugf, } if writer, ok := levelMapping[strings.ToUpper(level)]; ok { writer("%s: %s", category, line) } else { - r.log.Info(line) + r.log.Infof("%s: %s", category, line) } } else { r.log.Info(line) From 6c2073425d8686b6886494899ad46035ea3d03f0 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 6 Jul 2021 16:06:47 -0700 Subject: [PATCH 2/3] Consolidate if/else --- ingest/ledgerbackend/stellar_core_runner.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ingest/ledgerbackend/stellar_core_runner.go b/ingest/ledgerbackend/stellar_core_runner.go index 68605a60db..a7af8ac29e 100644 --- a/ingest/ledgerbackend/stellar_core_runner.go +++ b/ingest/ledgerbackend/stellar_core_runner.go @@ -221,11 +221,11 @@ func (r *stellarCoreRunner) getLogLineWriter() io.Writer { "DEBUG": r.log.Debugf, } - if writer, ok := levelMapping[strings.ToUpper(level)]; ok { - writer("%s: %s", category, line) - } else { - r.log.Infof("%s: %s", category, line) + writer := r.log.Infof + if f, ok := levelMapping[strings.ToUpper(level)]; ok { + writer = f } + writer("%s: %s", category, line) } else { r.log.Info(line) } From c1a16f828d6af96f0dc6c047324fd184ae438474 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 7 Jul 2021 09:18:42 -0700 Subject: [PATCH 3/3] Add CHANGELOG entry for this PR --- ingest/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ingest/CHANGELOG.md b/ingest/CHANGELOG.md index 27fa2b6e77..03c41c6dff 100644 --- a/ingest/CHANGELOG.md +++ b/ingest/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. This projec ### New Features * **Performance improvement**: the Captive Core backend now reuses bucket files whenever it finds existing ones in the corresponding `--captive-core-storage-path` (introduced in [v2.0](#v2.0.0)) rather than generating a one-time temporary sub-directory ([#3670](https://github.com/stellar/go/pull/3670)). Note that taking advantage of this feature requires [Stellar-Core v17.1.0](https://github.com/stellar/stellar-core/releases/tag/v17.1.0) or later. +### Bug Fixes +* The Stellar Core runner now parses logs from its underlying subprocess better [#3746](https://github.com/stellar/go/pull/3746). + ## v2.0.0