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(localnet): Redirect babylond stderr to stdout #24

Merged
merged 1 commit into from
Jun 27, 2022
Merged

Conversation

vitsalis
Copy link
Member

The babylond start command generates logs that are directed towards stderr leading to the tee command not capturing them.

The `babylond start` command generates logs that are directed
towards `stderr` leading to the `tee` command not capturing them.
@vitsalis
Copy link
Member Author

A minor issue with this is that the logs are colored, meaning that depending on the editor that is used to view them, these might not be presented in a user-friendly format.

An alternative would be to output logs in JSON format using the --log_format json CLI argument, which would generate something like this:

...
{"level":"info","module":"x/bank","amount":"41stake","from":"mint","time":"2022-06-22T09:48:00Z","message":"minted coins from module account"}
{"level":"info","module":"state","height":606,"num_invalid_txs":0,"num_valid_txs":0,"time":"2022-06-22T09:48:00Z","message":"executed block"}
{"level":"info","commit":"436F6D6D697449447B5B3638203137312031383120323332203230362031383820313439203131332032333320343420313132203135392031373820313420383620323133203134372032303420323136203836203233362039332031313720313035203938203535203235342032303120313633203620323435203136355D3A3235457D","time":"2022-06-22T09:48:01Z","message":"commit synced"}
{"level":"info","module":"state","app_hash":"44ABB5E8CEBC9571E92C709FB20E56D593CCD856EC5D75696237FEC9A306F5A5","height":606,"num_txs":0,"time":"2022-06-22T09:48:01Z","message":"committed state"}
{"level":"info","module":"txindex","height":606,"time":"2022-06-22T09:48:01Z","message":"indexed block"}
{"level":"info","module":"p2p","address":{"id":"e338694df1d06e52e2ea9ec16d8ba9e7dc002d7f","ip":"192.168.10.2","port":26656},"time":"2022-06-22T09:48:04Z","message":"Dialing peer"}
{"level":"info","module":"p2p","addr":{"id":"e338694df1d06e52e2ea9ec16d8ba9e7dc002d7f","ip":"192.168.10.2","port":26656},"err":"dial tcp 192.168.10.2:26656: i/o timeout","tries":9,"time":"2022-06-22T09:48:05Z","message":"Error reconnecting to peer. Trying again"}
...

Also, another thing to consider here is that given that the wrapper.sh script was retrieved from cosmos and osmosis has a similar script, maybe the stderr logs are not that useful to be captured.

@vitsalis vitsalis merged commit d668179 into main Jun 27, 2022
@vitsalis vitsalis deleted the fix-empty-logs branch June 27, 2022 06:08
KonradStaniec pushed a commit that referenced this pull request Oct 25, 2023
* fix prev cmt and more tests

* fix str

* fix tests

* more tests

* setup query params

* fix dels proto

* btc dels query

* refactor

* fuzz for dels

* fix proto

* fix tests

* fix tests

* fix tests

* fix comments

* remove checks

* add cli queries

* fix str

* fix str

* fix

* remove page checks

* fix str
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.

2 participants