theseus-rs / postgresql-embedded

Embed PostgreSQL database
Apache License 2.0
43 stars 5 forks source link

Possibility to suppress some binary data displayed during tests with RUST_LOG=debug #51

Closed helio-frota closed 3 months ago

helio-frota commented 3 months ago

Hi, when updating to 0.8x and running our tests with debug enabled, we see this:

2024-04-04_12-45

Apparently that is something related to postgresql_archive

}|w|aG\xfb?\xfe\xc2\xb4\xffr\xd0 l\xffp<\x1c\x0f\xc7\xc3\xf1p<\x1c\x0f\xc7\xc3\xf1p<\x1c\x0f\xc7\xc3\xf1p<\x1c\x0f\xc7\xc3\xf1\xff\xe5\xf8_\x9f\xe3\xa9\xaa\0\xe8\xed\x01" out_dir="/tmp/.tmpOVeMv2/16.2.3"}: postgresql_archive::archive: Extracting 1,303 files totalling 31.3 MB
helio-frota commented 3 months ago

I found the location :+1: https://github.com/theseus-rs/postgresql-embedded/blob/main/postgresql_archive/src/archive.rs#L409-L426

2024-04-04_15-26

I don't know if these are all the cases...

brianheineman commented 3 months ago

@helio-frota I believe what may be happening is that the archive bytes are being printed out with the trace instrumentation. I opened PR #52 to suppress the archive bytes as this is a bug and they should not be included in the trace span.

I just released v0.8.2 with this fix: https://github.com/theseus-rs/postgresql-embedded/releases/tag/v0.8.2

Please let me know if this addresses the issue you are seeing.

helio-frota commented 3 months ago

@brianheineman thanks!

now my foo.txt is 48K instead of 180M

  48K -rw-r--r--. 1 heliofrota  48K Apr  5 14:39 foo.txt

RUST_LOG=debug cargo test -- ingest_sboms --nocapture > foo.txt

:+1: