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

fix: emit status to stdout #420

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Nov 27, 2024

Part of celestiaorg/celestia-app#3823

Testing

After building a celestia-app binary that replaces cosmos-sdk with this, that status output goes to stdout so it can be piped to jq easily. In other words, this works:

$ ./build/celestia-appd status | jq .

@rootulp rootulp self-assigned this Nov 27, 2024
@rootulp rootulp requested a review from a team as a code owner November 27, 2024 22:06
@rootulp rootulp requested review from rach-id and ninabarbakadze and removed request for a team November 27, 2024 22:06
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

Copy link

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck. Are there any other areas where we should be using OutOrStdout instead of Println?

@julienrbrt
Copy link

julienrbrt commented Nov 29, 2024

If I may (sounds like the same issue Osmosis had), you should probably set the default output in your app instead: https://github.com/cosmos/cosmos-sdk/blob/v0.50.10/simapp/simd/cmd/root.go#L52-L54

cmd.Println is just doing its job here: https://pkg.go.dev/github.com/spf13/cobra#Command.Println

The SDK is using cmd.Println is more commands.

@rootulp
Copy link
Collaborator Author

rootulp commented Dec 2, 2024

Thanks for the review @julienrbrt ! Good idea, will do that in celestia-app and close this PR.

@rootulp rootulp closed this Dec 2, 2024
rootulp added a commit to celestiaorg/celestia-app that referenced this pull request Dec 3, 2024
Closes #3823
Motivation
celestiaorg/cosmos-sdk#420 (comment)

## Testing

```bash
make build
./build/celestia-appd status | jq .
``` 
works
mergify bot pushed a commit to celestiaorg/celestia-app that referenced this pull request Dec 3, 2024
Closes #3823
Motivation
celestiaorg/cosmos-sdk#420 (comment)

## Testing

```bash
make build
./build/celestia-appd status | jq .
```
works

(cherry picked from commit 615f1dc)
rootulp added a commit to celestiaorg/celestia-app that referenced this pull request Dec 4, 2024
Closes #3823
Motivation
celestiaorg/cosmos-sdk#420 (comment)

## Testing

```bash
make build
./build/celestia-appd status | jq .
``` 
works

<hr>This is an automatic backport of pull request #4071 done by
[Mergify](https://mergify.com).

Co-authored-by: Rootul P <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants