autocommit 2022-04-02 00:31:30 CEST
This commit is contained in:
parent
2dd433aa04
commit
6ad6d83b7e
34 changed files with 446 additions and 161 deletions
28
src/cli/set_log_level.rs
Normal file
28
src/cli/set_log_level.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use std::rc::Rc;
|
||||
use crate::cli::{GlobalArgs, SetLogArgs};
|
||||
use crate::tools::tool_client::ToolClient;
|
||||
use crate::wire::jay_compositor::SetLogLevel;
|
||||
|
||||
pub fn main(global: GlobalArgs, args: SetLogArgs) {
|
||||
let tc = ToolClient::new(global.log_level.into());
|
||||
let logger = Rc::new(Log {
|
||||
tc: tc.clone(),
|
||||
args,
|
||||
});
|
||||
tc.run(run(logger));
|
||||
}
|
||||
|
||||
struct Log {
|
||||
tc: Rc<ToolClient>,
|
||||
args: SetLogArgs,
|
||||
}
|
||||
|
||||
async fn run(log: Rc<Log>) {
|
||||
let tc = &log.tc;
|
||||
let comp = tc.jay_compositor().await;
|
||||
tc.send(SetLogLevel {
|
||||
self_id: comp,
|
||||
level: log.args.level as u32,
|
||||
});
|
||||
tc.round_trip().await;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue