-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Cosmovisor: be able to silence cosmovisor logs when running commands #15359
Comments
This is already the case. Which Cosmovisor version are you using? You have to run: $ cosmovisor version --output json When using the run command, it will always show logs. |
@julienrbrt when running your command, it indeed works correctly (though I am running in another issue I've described here #15360 (comment), but this is not the subject of this issue). But this only solves part of the problem, while it allows silencing logs querying for version, it still displays them for every other command, for example:
and this also results in the response not being a valid JSON (while it is a valid JSON if running this command without Cosmovisor). I assume checking for every command in
1.3.0, also tested with 1.4.0 |
I think your proposal makes sense. Disabling cosmovisor logger altogether could be an option. |
I may help implementing it, if needed, just need some guidance on how to do it in a better way. @julienrbrt jfyi |
Sure, if you want to 👍 |
@julienrbrt okay I am mostly done, I have one issue though. In
What do you think would be better approach, or do you maybe know some better ways to deal with it? |
No, you do not need to modify anything in |
@julienrbrt okay submitted this #15362, can you review please? |
I'll have a look, thank you! |
Done, thanks for letting me know. One thing I am not sure are tests, they fail even without my PR, so it's not something I broke within my changes I assume, so I didn't bother fixing them:
|
Summary
I have some tools that are running some cosmovisor subcommands and are expecting a valid JSON in a response, and when I use the binary itself without cosmovisor, it returns a valid json, but with cosmovisor, it adds its own logs, making the result an invalid JSON. Example: querying for version (note the
running app
line):Would be nice to have the way to omit such logs, see below for suggestions.
I am all in for implementing it by myself as I want to get my hands on cosmos-sdk as a contributor, just saying ;) I'd need some guidance for it though.
Problem Definition
Adding the way to silence cosmovisor logs would make it easier for other tools that rely on a plain output to be a valid JSON to use it.
I do not see any disadvantages on being able to set it up.
Proposal
I suggest having an environmental variable (like
DAEMON_DISABLE_LOGS
) that will silence logs if set to true.The text was updated successfully, but these errors were encountered: