Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

historyarchive: should not use default logger #5351

Closed
2opremio opened this issue Jun 16, 2024 · 1 comment · Fixed by #5352
Closed

historyarchive: should not use default logger #5351

2opremio opened this issue Jun 16, 2024 · 1 comment · Fixed by #5352
Labels

Comments

@2opremio
Copy link
Contributor

2opremio commented Jun 16, 2024

For instance:

// Intentionally avoid logging context errors
if stats := ai.GetStats(); len(stats) > 0 {
log.WithField("error", err).Warnf(
"Encountered an error with archive '%s'",
stats[0].GetBackendName())
}

Causes a log to happen without any control. A logger, controlled by the caller, should be used instead or no logging should happen.

For instance, this causes untrackable logs to happen in tests . e.g: https://github.com/stellar/soroban-rpc/actions/runs/9538438244/job/26287637351?pr=216#step:10:22

The log cannot be attributed to a particular test, which is problematic (and noisy)

@2opremio 2opremio added the bug label Jun 16, 2024
@2opremio 2opremio mentioned this issue Jun 16, 2024
@urvisavla
Copy link
Contributor

@tamirms , @sreuland, should we also be following to the same pattern of passing the logger object when creating the DataStore object here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@2opremio @urvisavla and others