Clean up some logging output
This commit is contained in:
parent
91f714dc11
commit
096aedc0d4
3 changed files with 7 additions and 7 deletions
|
@ -134,7 +134,7 @@ impl App {
|
||||||
}
|
}
|
||||||
DaemonCommand::OpenMany { windows, sender } => {
|
DaemonCommand::OpenMany { windows, sender } => {
|
||||||
let result = windows.iter().try_for_each(|w| self.open_window(w, None, None, None, None));
|
let result = windows.iter().try_for_each(|w| self.open_window(w, None, None, None, None));
|
||||||
respond_with_error(sender, result)?;
|
respond_with_result(sender, result)?;
|
||||||
}
|
}
|
||||||
DaemonCommand::OpenWindow { window_name, pos, size, anchor, screen: monitor, should_toggle, sender } => {
|
DaemonCommand::OpenWindow { window_name, pos, size, anchor, screen: monitor, should_toggle, sender } => {
|
||||||
let result = if should_toggle && self.open_windows.contains_key(&window_name) {
|
let result = if should_toggle && self.open_windows.contains_key(&window_name) {
|
||||||
|
@ -142,11 +142,11 @@ impl App {
|
||||||
} else {
|
} else {
|
||||||
self.open_window(&window_name, pos, size, monitor, anchor)
|
self.open_window(&window_name, pos, size, monitor, anchor)
|
||||||
};
|
};
|
||||||
respond_with_error(sender, result)?;
|
respond_with_result(sender, result)?;
|
||||||
}
|
}
|
||||||
DaemonCommand::CloseWindow { window_name, sender } => {
|
DaemonCommand::CloseWindow { window_name, sender } => {
|
||||||
let result = self.close_window(&window_name);
|
let result = self.close_window(&window_name);
|
||||||
respond_with_error(sender, result)?;
|
respond_with_result(sender, result)?;
|
||||||
}
|
}
|
||||||
DaemonCommand::PrintState { all, sender } => {
|
DaemonCommand::PrintState { all, sender } => {
|
||||||
let vars = self.eww_state.get_variables().iter();
|
let vars = self.eww_state.get_variables().iter();
|
||||||
|
@ -381,7 +381,7 @@ fn get_monitor_geometry(n: Option<i32>) -> Result<gdk::Rectangle> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// In case of an Err, send the error message to a sender.
|
/// In case of an Err, send the error message to a sender.
|
||||||
fn respond_with_error<T>(sender: DaemonResponseSender, result: Result<T>) -> Result<()> {
|
fn respond_with_result<T>(sender: DaemonResponseSender, result: Result<T>) -> Result<()> {
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => sender.send_success(String::new()),
|
Ok(_) => sender.send_success(String::new()),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub fn handle_client_only_action(paths: &EwwPaths, action: ActionClientOnly) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn do_server_call(stream: &mut UnixStream, action: &opts::ActionWithServer) -> Result<Option<DaemonResponse>> {
|
pub fn do_server_call(stream: &mut UnixStream, action: &opts::ActionWithServer) -> Result<Option<DaemonResponse>> {
|
||||||
log::info!("Forwarding options to server");
|
log::debug!("Forwarding options to server");
|
||||||
stream.set_nonblocking(false).context("Failed to set stream to non-blocking")?;
|
stream.set_nonblocking(false).context("Failed to set stream to non-blocking")?;
|
||||||
|
|
||||||
let message_bytes = bincode::serialize(&action)?;
|
let message_bytes = bincode::serialize(&action)?;
|
||||||
|
|
|
@ -129,9 +129,9 @@ fn listen_for_daemon_response(mut recv: DaemonResponseReceiver) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_server_command(paths: &EwwPaths, action: &ActionWithServer, connect_attempts: usize) -> Result<()> {
|
fn handle_server_command(paths: &EwwPaths, action: &ActionWithServer, connect_attempts: usize) -> Result<()> {
|
||||||
log::info!("Trying to find server process at socket {}", paths.get_ipc_socket_file().display());
|
log::debug!("Trying to find server process at socket {}", paths.get_ipc_socket_file().display());
|
||||||
let mut stream = attempt_connect(&paths.get_ipc_socket_file(), connect_attempts).context("Failed to connect to daemon")?;
|
let mut stream = attempt_connect(&paths.get_ipc_socket_file(), connect_attempts).context("Failed to connect to daemon")?;
|
||||||
log::info!("Connected to Eww server ({}).", &paths.get_ipc_socket_file().display());
|
log::debug!("Connected to Eww server ({}).", &paths.get_ipc_socket_file().display());
|
||||||
let response = client::do_server_call(&mut stream, action).context("Error while forwarding command to server")?;
|
let response = client::do_server_call(&mut stream, action).context("Error while forwarding command to server")?;
|
||||||
if let Some(response) = response {
|
if let Some(response) = response {
|
||||||
println!("{}", response);
|
println!("{}", response);
|
||||||
|
|
Loading…
Add table
Reference in a new issue