You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing test suites for programs that wrap the Solana CLI, test runner logs get populated with unnecessary print statements (in the context of running tests) that makes the logs cluttered and difficult to read.
In a test runner (regardless of language or framework) the CLI error ends up printing to the same process as the test runner. For example, a test that's covering a failure scenario shows
......Error: Bad parameter: SIGNATURE
.error: Invalid value for'--signer <PUBKEY>': No such file or directory (os error 2)
.Error: Invalid signature
.
Finished in 0.39404 seconds (files took 3.66 seconds to load)
9 examples, 0 failures
Proposed Solution
It would be nice for the CLI to support error or log suppression (the opposite of the currently supported --verbose flag). When set, commands wouldn't print any contextual information or errors to the console and only return the data that they are being run to collect - or a blank value.
Example solution:
# Current
$ solana balance -k invalid_keypair
=> Error: Dynamic program error: No default signer found, run "solana-keygen new -o not_a_keypair" to create a new one
$ solana balance -k valid_keypair
=> 10 SOL
# Solution
$ solana balance -k invalid_keypair --silent
=>
$ solana balance -k valid_keypair --silent
=> 10 SOL
The text was updated successfully, but these errors were encountered:
sebscholl
changed the title
Add --silent flag to Solana CLI for turning of console output when running commands
Add --silent flag to Solana CLI for turning off stdout for error/info contexts when running commands
Aug 6, 2024
Problem
When writing test suites for programs that wrap the Solana CLI, test runner logs get populated with unnecessary print statements (in the context of running tests) that makes the logs cluttered and difficult to read.
In a test runner (regardless of language or framework) the CLI error ends up printing to the same process as the test runner. For example, a test that's covering a failure scenario shows
Proposed Solution
It would be nice for the CLI to support error or log suppression (the opposite of the currently supported
--verbose
flag). When set, commands wouldn't print any contextual information or errors to the console and only return the data that they are being run to collect - or a blank value.Example solution:
The text was updated successfully, but these errors were encountered: