1
0
Fork 0
forked from wry/wry

compositor: add LogLevel enum

This commit is contained in:
Julian Orth 2026-03-07 11:40:45 +01:00
parent be0782f5d2
commit 042070ee99
26 changed files with 131 additions and 106 deletions

View file

@ -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;
});

View file

@ -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;
});

View file

@ -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;
});

View file

@ -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;
});

View file

@ -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;
});

View file

@ -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),

View file

@ -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;
});
}

View file

@ -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;
});

View file

@ -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;
});

View file

@ -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,

View file

@ -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;
});

View file

@ -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,

View file

@ -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,

View file

@ -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;
}

View file

@ -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(),

View file

@ -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;
});

View file

@ -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;
});