[red-knot] LSP: only emit WARN logs from non-red-knot sources (#16760)

Currently the red-knot LSP server emits any log messages of level `INFO`
or higher from non-red-knot crates. This makes its output quite verbose,
because Salsa emits an `INFO` level message every time it executes a
query. I use red-knot as LSP with neovim, and this spams the log file
quite a lot.

It seems like a better default to only emit `WARN` or higher messages
from non-red-knot sources.

I confirmed that this fixes the nvim LSP log spam.
This commit is contained in:
Carl Meyer 2025-03-15 08:47:50 -07:00 committed by GitHub
parent 1fab292ec1
commit 2de8455e43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,7 +102,7 @@ impl<S> tracing_subscriber::layer::Filter<S> for LogLevelFilter {
let filter = if meta.target().starts_with("red_knot") {
self.filter.trace_level()
} else {
tracing::Level::INFO
tracing::Level::WARN
};
meta.level() <= &filter