Skip to content

Commit

Permalink
ingest/ledgerbackend: Minor Core logging fixes (#3225)
Browse files Browse the repository at this point in the history
* Regexp missed pubkeys with digits.
* After each ledger close Stellar-Core prints an empty line. Removed
empty lines from log.
  • Loading branch information
bartekn authored Nov 16, 2020
1 parent f9ab742 commit fbc77c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ingest/ledgerbackend/stellar_core_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,18 @@ 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-Z]{4} \[(\w+) ([A-Z]+)\] (.*)`)
levelRx := regexp.MustCompile(`G[A-Z0-9]{4} \[(\w+) ([A-Z]+)\] (.*)`)
for {
line, err := br.ReadString('\n')
if err != nil {
break
}
line = dateRx.ReplaceAllString(line, "")
line = strings.TrimSpace(line)

if line == "" {
continue
}

// If there's a logger, we attempt to extract metadata about the log
// entry, then redirect it to the logger. Otherwise, we just use stdout.
Expand Down

0 comments on commit fbc77c9

Please sign in to comment.