compositor: add LogLevel enum
This commit is contained in:
parent
be0782f5d2
commit
042070ee99
26 changed files with 131 additions and 106 deletions
|
|
@ -67,7 +67,7 @@ struct KillIdArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, clients_args: ClientsArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let clients = Rc::new(Clients { tc: tc.clone() });
|
||||
clients.run(clients_args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ pub enum ColorManagementCmd {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, args: ColorManagementArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let cm = ColorManagement { tc: tc.clone() };
|
||||
cm.run(args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ pub struct DecayArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, damage_tracking_args: DamageTrackingArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let damage_tracking = Rc::new(DamageTracking { tc: tc.clone() });
|
||||
damage_tracking.run(damage_tracking_args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ pub struct IdleSetGracePeriodArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, args: IdleArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let idle = Idle { tc: tc.clone() };
|
||||
idle.run(args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ pub struct UseHardwareCursorArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, args: InputArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let idle = Rc::new(Input { tc: tc.clone() });
|
||||
idle.run(args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: LogArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let logger = Rc::new(Log {
|
||||
tc: tc.clone(),
|
||||
path: RefCell::new(None),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
run(tc).await;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ fn blend_space_possible_values() -> Vec<PossibleValue> {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, args: RandrArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let idle = Rc::new(Randr { tc: tc.clone() });
|
||||
idle.run(args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub struct ReexecArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, reexec_args: ReexecArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let rexec = Rc::new(Reexec { tc: tc.clone() });
|
||||
rexec.run(reexec_args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: RunPrivilegedArgs) {
|
||||
Logger::install_stderr(global.log_level.into());
|
||||
Logger::install_stderr(global.log_level);
|
||||
if let Some(xrd) = xrd() {
|
||||
let mut wd = match std::env::var(WAYLAND_DISPLAY) {
|
||||
Ok(v) => v,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ pub struct RunTaggedArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, run_tagged_args: RunTaggedArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let run_tagged = Rc::new(RunTagged { tc: tc.clone() });
|
||||
run_tagged.run(run_tagged_args).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: ScreenshotArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let screenshot = Rc::new(Screenshot {
|
||||
tc: tc.clone(),
|
||||
args,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: SeatTestArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let screenshot = Rc::new(SeatTest {
|
||||
tc: tc.clone(),
|
||||
args,
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ use {
|
|||
tools::tool_client::{ToolClient, with_tool_client},
|
||||
wire::jay_compositor::SetLogLevel,
|
||||
},
|
||||
linearize::Linearize,
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: SetLogArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let logger = Rc::new(Log {
|
||||
tc: tc.clone(),
|
||||
args,
|
||||
|
|
@ -27,7 +28,7 @@ async fn run(log: Rc<Log>) {
|
|||
let comp = tc.jay_compositor().await;
|
||||
tc.send(SetLogLevel {
|
||||
self_id: comp,
|
||||
level: log.args.level as u32,
|
||||
level: log.args.level.linearize() as u32,
|
||||
});
|
||||
tc.round_trip().await;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ struct QueryWorkspaceNameArgs {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, tree_args: TreeArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let comp = tc.jay_compositor().await;
|
||||
let tree = Rc::new(Tree {
|
||||
tc: tc.clone(),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use {
|
|||
};
|
||||
|
||||
pub fn main(global: GlobalArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let logger = Rc::new(Unlocker { tc: tc.clone() });
|
||||
run(logger).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ pub enum CliScalingMode {
|
|||
}
|
||||
|
||||
pub fn main(global: GlobalArgs, args: XwaylandArgs) {
|
||||
with_tool_client(global.log_level.into(), |tc| async move {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
let xwayland = Xwayland { tc: tc.clone() };
|
||||
xwayland.run(args).await;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue