Closed nguiard closed 1 year ago
LibPQ.jl uses https://github.com/invenia/Memento.jl for logging (which I think we can remove at some point), so you can use functions from that package to suppress logs.
You can either temporarily set the log level for LibPQ.jl for your function:
setlevel!(getlogger("LibPQ"), "critical") do
mything()
end
set the log level globally for your application with a setlevel!(getlogger("LibPQ"), "critical")
, or use Memento filters (I'd have to hunt through Memento for a good example of how to do that).
Oh thanks a lot!
Hi, thanks a lot for this library!
I have a bit of code that, by design, tries to connect to a non-existent database. I expect an error so I put it in a try/catch block, but libpq's red error message is still printed to screen. To be clear, the rest of the code works, it's just a bit annoying that users would see a red message that actually shouldn't be treated as an error.
Even with Suppressor.jl macros or setting
throw_error=false
, the message still gets through. Any idea how I could disable that temporarily?Minimal example:
output (in red):