Add logs in places

This commit is contained in:
Ottatop 2024-05-06 23:52:29 -05:00
parent dc70a8a3e7
commit b5707daa86
4 changed files with 10 additions and 6 deletions

2
TODO.md Normal file
View file

@ -0,0 +1,2 @@
- Use compositor PID to uniquely ID gRPC socket
- Log git commit on startup and add to --help/-V

View file

@ -419,7 +419,7 @@ impl Pinnacle {
self.input_state.kill_keybind = Some(kill_keybind);
if metaconfig.no_config {
info!("`--no-config` was set, not spawning config");
info!("`no-config` option was set, not spawning config");
return Ok(());
}
@ -626,7 +626,7 @@ impl Pinnacle {
let uds = tokio::net::UnixListener::bind(&socket_path)?;
let uds_stream = tokio_stream::wrappers::UnixListenerStream::new(uds);
std::env::set_var("PINNACLE_GRPC_SOCKET", socket_path);
std::env::set_var("PINNACLE_GRPC_SOCKET", &socket_path);
let grpc_server = tonic::transport::Server::builder()
.add_service(refl_service)
@ -646,6 +646,8 @@ impl Pinnacle {
}
}));
info!("gRPC server started at {}", socket_path.display());
Ok(())
}
}

View file

@ -91,10 +91,8 @@ async fn main() -> anyhow::Result<()> {
let backend: cli::Backend = match (cli.backend, cli.force) {
(None, _) => {
if in_graphical_env {
info!("Starting winit backend");
cli::Backend::Winit
} else {
info!("Starting udev backend");
cli::Backend::Udev
}
}
@ -110,7 +108,6 @@ async fn main() -> anyhow::Result<()> {
return Ok(());
}
} else {
info!("Starting winit backend");
cli::Backend::Winit
}
}
@ -127,7 +124,6 @@ async fn main() -> anyhow::Result<()> {
return Ok(());
}
} else {
info!("Starting udev backend");
cli::Backend::Udev
}
}
@ -182,6 +178,8 @@ async fn main() -> anyhow::Result<()> {
if !metaconfig.no_config {
state.pinnacle.start_config(false)?;
} else {
info!("`no-config` option was set, not spawning config");
}
event_loop.run(None, &mut state, |state| {

View file

@ -332,6 +332,7 @@ impl State {
let (backend, pinnacle) = match backend {
cli::Backend::Winit => {
info!("Starting winit backend");
let uninit_winit = Winit::try_new(display.handle())?;
let mut pinnacle = Pinnacle::new(
display,
@ -345,6 +346,7 @@ impl State {
(backend::Backend::Winit(winit), pinnacle)
}
cli::Backend::Udev => {
info!("Starting udev backend");
let uninit_udev = Udev::try_new(display.handle())?;
let mut pinnacle = Pinnacle::new(
display,