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

agd start standard output/error messages are not consistent #10820

Open
michaelfig opened this issue Jan 8, 2025 · 0 comments · May be fixed by #10821
Open

agd start standard output/error messages are not consistent #10820

michaelfig opened this issue Jan 8, 2025 · 0 comments · May be fixed by #10821
Assignees
Labels
bug Something isn't working cosmic-swingset package: cosmic-swingset telemetry

Comments

@michaelfig
Copy link
Member

michaelfig commented Jan 8, 2025

Describe the bug

Standard output and error logs generated by the SwingSet VM when running agd start are not consistent with the Golang Zerolog output.

The VM should match the format of the format of the Golang logs controlled by agd start --log_format=plain or --log_format=json. If json is specified, then the output format should be entirely machine-readable, like 12-factor apps are designed.

Currently, the VM ignores any --log_format flags.

To Reproduce

Steps to reproduce the behavior:

  1. Run agd start --log_format=json
  2. Note that the raw JS console messages, prefixed with a timestamp and source are sent to the process output.
partial sample JSON output ``` {"level":"info","module":"consensus","appHeight":26,"stateHeight":26,"storeHeight":27,"time":"2025-01-11T20:46:34-06:00","message":"ABCI Replay Blocks"} {"level":"info","module":"consensus","time":"2025-01-11T20:46:34-06:00","message":"Replay last block using real app"} 2025-01-12T02:46:34.199Z Loading slog sender modules: @agoric/telemetry/src/flight-recorder.js 2025-01-12T02:46:34.292Z chain-main: Prometheus scrape endpoint: http://0.0.0.0:9464/metrics 2025-01-12T02:46:34.898Z launch-chain: Launching SwingSet kernel ```
  1. Run agd start --log_format=plain
  2. Note that the JS console messages have the same appearance as they do in step 2.
partial sample plain output ``` 8:43PM INF received complete proposal block hash=23405292798F9EDD0C74244E092EC511CB8F0B2AA2A888E470367B07A2525507 height=27 module=consensus 8:43PM INF finalizing commit of block hash={} height=27 module=consensus num_txs=0 root=2E9C9AB95656BE0A36A78049F529A89EF58E457FA3905FA64CE791E3BB9F737D 2025-01-12T02:43:58.199Z Loading slog sender modules: @agoric/telemetry/src/flight-recorder.js 2025-01-12T02:43:59.292Z chain-main: Prometheus scrape endpoint: http://0.0.0.0:9464/metrics 2025-01-12T02:44:00.898Z launch-chain: Launching SwingSet kernel 8:44PM INF Timed out dur=3000 height=27 module=consensus round=0 step=3 ```

Expected behavior

All of the --log_format=json messages should be in JSON format. The --log_format=plain messages should look similar to the ones produced by the Golang "log" package. For each format, both Golang and the VM should produce similar timestamps.

JSON

{"level":"info","module":"consensus","appHeight":26,"stateHeight":26,"storeHeight":27,"time":"2025-01-11T20:46:34-06:00","message":"ABCI Replay Blocks"}
{"level":"info","module":"consensus","time":"2025-01-11T20:46:34-06:00","message":"Replay last block using real app"}
{"level":"warn","time":"2025-01-11T20:46:34-06:00","message":"slog-sender: Loading slog sender modules: @agoric/telemetry/src/flight-recorder.js"}
{"level":"warn","time":"2025-01-11T20:46:34-06:00","message":"chain-main: Prometheus scrape endpoint: http://0.0.0.0:9464/metrics"}
{"level":"info","time":"2025-01-11T20:46:34-06:00","message":"launch-chain: Launching SwingSet kernel"}

Plain

8:43PM INF received complete proposal block hash=23405292798F9EDD0C74244E092EC511CB8F0B2AA2A888E470367B07A2525507 height=27 module=consensus
8:43PM INF finalizing commit of block hash={} height=27 module=consensus num_txs=0 root=2E9C9AB95656BE0A36A78049F529A89EF58E457FA3905FA64CE791E3BB9F737D
8:43PM WRN slog-sender: Loading slog sender modules: @agoric/telemetry/src/flight-recorder.js
8:43PM WRN chain-main: Prometheus scrape endpoint: http://0.0.0.0:9464/metrics
8:43PM INF launch-chain: Launching SwingSet kernel
8:44PM INF Timed out dur=3000 height=27 module=consensus round=0 step=3

Colouring the plain output with matching ANSI escapes is a non-goal, as plain is only intended for human consumption.

Platform Environment

  • MacOS, Node.js v20.
  • Nothing special about my platform.
  • what version of the Agoric-SDK are you using? agoric-upgrade-16av-1595-g42d96f2873
@michaelfig michaelfig added bug Something isn't working cosmic-swingset package: cosmic-swingset telemetry labels Jan 8, 2025
@michaelfig michaelfig self-assigned this Jan 8, 2025
@michaelfig michaelfig changed the title agd start standard output/error logs are not consistently formatted agd start standard output/error logs are not consist Jan 8, 2025
@michaelfig michaelfig changed the title agd start standard output/error logs are not consist agd start standard output/error messages are not consistent Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cosmic-swingset package: cosmic-swingset telemetry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant