Extra logging for aura

This commit is contained in:
Luke D. Jones
2024-03-23 11:27:20 +13:00
parent 4e778a3d28
commit 193f9dfa1e
4 changed files with 5 additions and 7 deletions

View File

@@ -142,10 +142,6 @@ impl StdConfig for AuraConfig {
impl StdConfigLoad for AuraConfig {} impl StdConfigLoad for AuraConfig {}
impl AuraConfig { impl AuraConfig {
pub fn set_filename(&mut self, prod_id: AuraDevice) {
self.config_name = format!("aura_{prod_id:?}.ron");
}
pub fn from_default_support(prod_id: AuraDevice, support_data: &LaptopLedData) -> Self { pub fn from_default_support(prod_id: AuraDevice, support_data: &LaptopLedData) -> Self {
// create a default config here // create a default config here
let enabled = if prod_id.is_new_style() { let enabled = if prod_id.is_new_style() {

View File

@@ -60,6 +60,7 @@ pub struct CtrlKbdLed {
impl CtrlKbdLed { impl CtrlKbdLed {
pub fn find_all(data: &LaptopLedData) -> Result<Vec<Self>, RogError> { pub fn find_all(data: &LaptopLedData) -> Result<Vec<Self>, RogError> {
info!("Searching for all Aura devices");
let mut devices = Vec::new(); let mut devices = Vec::new();
let mut enumerator = udev::Enumerator::new().map_err(|err| { let mut enumerator = udev::Enumerator::new().map_err(|err| {
@@ -91,6 +92,7 @@ impl CtrlKbdLed {
devices.push(dev); devices.push(dev);
} }
} }
info!("Found {} Aura devices", devices.len());
Ok(devices) Ok(devices)
} }
@@ -126,7 +128,6 @@ impl CtrlKbdLed {
let mut config_init = AuraConfig::new_with(prod_id); let mut config_init = AuraConfig::new_with(prod_id);
// config_init.set_filename(prod_id); // config_init.set_filename(prod_id);
let mut config_loaded = config_init.clone().load(); let mut config_loaded = config_init.clone().load();
config_loaded.set_filename(prod_id);
// update the initialised data with what we loaded from disk // update the initialised data with what we loaded from disk
for mode in &mut config_init.builtins { for mode in &mut config_init.builtins {
// update init values from loaded values if they exist // update init values from loaded values if they exist

View File

@@ -7,7 +7,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use log::{error, info, warn}; use log::{debug, error, info, warn};
use mio::{Events, Interest, Poll, Token}; use mio::{Events, Interest, Poll, Token};
use rog_aura::aura_detection::LaptopLedData; use rog_aura::aura_detection::LaptopLedData;
use rog_aura::usb::AuraDevice; use rog_aura::usb::AuraDevice;
@@ -146,6 +146,7 @@ impl AuraManager {
let zbus = CtrlAuraZbus::new(ctrl, sig_ctx); let zbus = CtrlAuraZbus::new(ctrl, sig_ctx);
// Now add it to device list // Now add it to device list
let sig_ctx = CtrlAuraZbus::signal_context(&conn_copy)?; let sig_ctx = CtrlAuraZbus::signal_context(&conn_copy)?;
debug!("Starting Aura at {path}");
start_tasks(zbus, &mut conn_copy, sig_ctx, &path) start_tasks(zbus, &mut conn_copy, sig_ctx, &path)
.await?; .await?;
Ok::<(), RogError>(()) Ok::<(), RogError>(())

View File

@@ -2,7 +2,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-03-22 06:44+0000\n" "POT-Creation-Date: 2024-03-22 06:45+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"