mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-08-03 16:39:16 +00:00
reimplemented+simplified switchable server logging
don't know how well it interacts with `log` (or upcoming tracing), so this may be temporary and/or incomplete. But it works for my application code at the least (as opposed to library code)
This commit is contained in:
parent
e7221304da
commit
a797d5b378
7 changed files with 54 additions and 44 deletions
|
@ -1,10 +0,0 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
use logging::{Level, error};
|
||||
|
||||
pub fn handle_log_level_change<F: FnOnce(Level)>(log_level: String, callback: F) {
|
||||
match Level::from_str(log_level.as_str()) {
|
||||
Ok(level) => callback(level),
|
||||
Err(_) => error!("got unexpected log level from config"; "level" => log_level),
|
||||
};
|
||||
}
|
|
@ -3,12 +3,12 @@ use logging::{logger, FutureExt};
|
|||
use server::Server;
|
||||
use tower_lsp::LspService;
|
||||
|
||||
mod configuration;
|
||||
mod navigation;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let _guard = logging::set_level(logging::Level::Debug);
|
||||
// start with debug log level, and then adjust once we get the configuration from the client.
|
||||
logging::set_level(logging::Level::Debug);
|
||||
|
||||
let stdin = tokio::io::stdin();
|
||||
let stdout = tokio::io::stdout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue