diff --git a/espanso/src/main.rs b/espanso/src/main.rs index 708cd8d..7db6bf2 100644 --- a/espanso/src/main.rs +++ b/espanso/src/main.rs @@ -36,6 +36,7 @@ use simplelog::{ use crate::{ cli::{LogMode, PathsOverrides}, config::load_config, + util::log_system_info, }; mod capabilities; @@ -586,6 +587,7 @@ For example, specifying 'email' is equivalent to 'match/email.yml'."#)) info!("reading configs from: {:?}", paths.config); info!("reading packages from: {:?}", paths.packages); info!("using runtime dir: {:?}", paths.runtime); + log_system_info(); if handler.requires_config { let config_result = diff --git a/espanso/src/util.rs b/espanso/src/util.rs index 1e4a22f..42602f5 100644 --- a/espanso/src/util.rs +++ b/espanso/src/util.rs @@ -17,7 +17,9 @@ * along with espanso. If not, see . */ +use log::info; use std::process::Command; +use sysinfo::{System, SystemExt}; #[cfg(target_os = "windows")] pub fn set_command_flags(command: &mut Command) { @@ -43,3 +45,13 @@ pub fn attach_console() { pub fn attach_console() { // Not necessary on Linux and macOS } + +pub fn log_system_info() { + let sys = System::new(); + info!( + "system info: {} v{} - kernel: {}", + sys.name().unwrap_or_default(), + sys.os_version().unwrap_or_default(), + sys.kernel_version().unwrap_or_default() + ); +}