Skip to content

Commit

Permalink
services/horizon: Trivial improvements to Stellar Core log parsing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic authored Nov 23, 2020
1 parent 15de5ff commit f1c5d71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ingest/ledgerbackend/stellar_core_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (r *stellarCoreRunner) getLogLineWriter() io.Writer {
// Strip timestamps from log lines from captive stellar-core. We emit our own.
dateRx := regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3} `)
go func() {
levelRx := regexp.MustCompile(`G[A-Z0-9]{4} \[(\w+) ([A-Z]+)\] (.*)`)
levelRx := regexp.MustCompile(`\[(\w+) ([A-Z]+)\] (.*)`)
for {
line, err := br.ReadString('\n')
if err != nil {
Expand Down Expand Up @@ -160,10 +160,10 @@ func (r *stellarCoreRunner) getLogLineWriter() io.Writer {
if writer, ok := levelMapping[strings.ToUpper(level)]; ok {
writer("%s: %s", category, line)
} else {
r.Log.Infof(line)
r.Log.Info(line)
}
} else {
r.Log.Infof(line)
r.Log.Info(line)
}
}
}()
Expand Down

0 comments on commit f1c5d71

Please sign in to comment.