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

Logging to stdout instead of stderr #476

Closed
xanatos opened this issue Mar 16, 2023 · 3 comments
Closed

Logging to stdout instead of stderr #476

xanatos opened this issue Mar 16, 2023 · 3 comments

Comments

@xanatos
Copy link

xanatos commented Mar 16, 2023

I've noticed that with the newer version (1.5.0), at least under Windows, the logging happens on stdout. In the previous version (1.4.0) it was on stderr (I was redirecting the stderr to a file, and when installing the new version, nothing was being written).

Question: do you write everything to stdout now, both info, warns and errors, or should I save both stdout AND stderr?

@metachris
Copy link
Collaborator

Interesting 🤔

Already in v1.4.0, the log output was set to Stdout: https://github.com/flashbots/mev-boost/blob/v1.4.0/cli/main.go#L74

Not sure how that went to stderr in your case before... might it have been an even earlier mev-boost version?

@xanatos
Copy link
Author

xanatos commented Mar 16, 2023

Interesting 🤔

Already in v1.4.0, the log output was set to Stdout: https://github.com/flashbots/mev-boost/blob/v1.4.0/cli/main.go#L74

Not sure how that went to stderr in your case before... might it have been an even earlier mev-boost version?

I still had the .gz of the 1.4.0 on the hdd, so I extracted it on another computer and tested it. I can confirm that it was writing on stderr:

Redirecting stdout to nul:

D:\mev>mev-boost -mainnet -relay-check -relay https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net > nul
time="2023-03-16T23:11:57+01:00" level=info msg="starting mev-boost" version=1.4.0
time="2023-03-16T23:11:57+01:00" level=info msg="using genesis fork version: 0x00000000" version=1.4.0
time="2023-03-16T23:11:57+01:00" level=info msg="using 1 relays" version=1.4.0
time="2023-03-16T23:11:57+01:00" level=info msg="relay #1: https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net" version=1.4.0
time="2023-03-16T23:11:57+01:00" level=info msg="listening on localhost:18550" version=1.4.0

redirecting stderr to nul

D:\mev>mev-boost -mainnet -relay-check -relay https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net 2> nul

(no output is visible)

@metachris
Copy link
Collaborator

metachris commented Mar 18, 2023

I just took a closer look, and you are right -- v1.4.0 did log to stderr, even though there was code to set it to stdout. But this code set it for logrus in general but not the specific instance!

This change in log output to stdout was introduced in #401 - released in v1.5.0

The intention was to already log to stdout before, and this PR was meant to fix it.

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

No branches or pull requests

2 participants