risinglightdb / sqllogictest-rs

Sqllogictest (dialect with extensions) parser and runner in Rust.
Apache License 2.0
172 stars 45 forks source link

Don't log all records (or at-least provide option to control logging) #158

Closed vrongmeal closed 1 year ago

vrongmeal commented 1 year ago

The library logs all the records while running. The only logs I personally care about is queries and statements. Else, the logs are too noisy to look at!

Can we downgrade the logging from info to debug? Or provide an option to do so? Also an option to control what records to log. This would really be helpful.

PS: I am open to working on this :)

xxchan commented 1 year ago

Hi, IIRC we don’t have any logging in the lib. Can you share how are you using it and what’s the output?

vrongmeal commented 1 year ago

It's this tiny little line – https://github.com/risinglightdb/sqllogictest-rs/blob/7b1a671a02838fb2fd137346627a6530f5cd683a/sqllogictest/src/runner.rs#L574

xxchan commented 1 year ago

Oops… Yeah downgrading it is ok to me. PR is welcomed.

Btw you can also simply disable the log from sqllogictest, since there are no other useful logs. 🤔

vrongmeal commented 1 year ago

I'll submit a PR to downgrade it.

What do you mean by disabling from sqllogictest?

skyzh commented 1 year ago

You can configure your logger to only log events from your crates and disable sqllogictest's.

One way to do this is to use the tracing-env-logger crate (if this is the correct name), and pass RUST_LOG=your_crate=info, so that all logs from sqllogictest will be disabled.

xxchan commented 1 year ago

Yes, check the doc of the logger you are using. Any logger should have similar filtering mechanism. e.g., env_logger

vrongmeal commented 1 year ago

aah thanks for the tip!

vrongmeal commented 1 year ago

Submitted #159 since the log seems unintentional.