diff --git a/Cargo.lock b/Cargo.lock index 865380d..39dc290 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3159,6 +3159,7 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ + "chrono", "matchers", "nu-ansi-term", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 7c84cce..cb5d61e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ fastrand = "2.0.0" rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false } sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] } tokio = { version = "1.32.0", features = ["full"] } -tracing-subscriber = { version = "0.3.17", features = ["fmt", "std", "time", "local-time", "env-filter"] } +tracing-subscriber = { version = "0.3.17", features = ["fmt", "std", "chrono", "time", "local-time", "env-filter"] } tracing = "0.1.37" time = { version = "0.3.29", features = ["formatting", "macros"] } obws = "0.11.5" diff --git a/TODO.org b/TODO.org index ccb96a5..83bf41f 100644 --- a/TODO.org +++ b/TODO.org @@ -30,6 +30,11 @@ To display all the slides... Actually as I type this out, I'm starting to think that the slide_model still needs all the metadata that the slide_object will have. The reason being that I'd like to have details in the slide preview system that can only come from having all the info available to QML. This makes the QML preview system a lot easier to reason with because you can use property binding rather than needing to create a custom building system for each arbitrary detail we want to add the to the previews. All that said, what properties does the slide_object and slide_model really need then? Is there a way for the model to have fewer props? +** TODO Saving needs to be asynchronous +I need to figure out how to make saving asynchronous in order to not lock the ui thread while saving. + +Tokio seems to not be working the way I expected.... + ** TODO [#B] Fix updating things in the song editor [[file:~/dev/lumina/src/qml/presenter/SongEditor.qml::function updateLyrics(lyrics) {]] The core problem with this is that when we set the song, the index to get the item is the index of the item in the vector, not the ID in the DB. So, when we get a song, we can't use that index to update things, we need to make sure we are using the id so that all the new work in updating the right item is done correctly. diff --git a/src/main.cpp b/src/main.cpp index acbf482..83c6fd8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) QCoreApplication::setOrganizationName(QStringLiteral("lumina")); QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org")); QCoreApplication::setApplicationName(QStringLiteral("lumina")); - qSetMessagePattern("[%{type} %{time h:m:s ap}: %{function} in %{file}]: %{message}\n"); + qSetMessagePattern("%{category}: %{time h:m:s ap} %{type} %{function}: %{message}\n %{file}"); #ifdef Q_OS_WINDOWS QIcon::setFallbackThemeName("breeze"); diff --git a/src/rust/utils.rs b/src/rust/utils.rs index c27f7e8..e19de21 100644 --- a/src/rust/utils.rs +++ b/src/rust/utils.rs @@ -2,7 +2,7 @@ use std::pin::Pin; use time::macros::format_description; use tokio::runtime::Runtime; -use tracing::{debug, info}; +use tracing::{debug, info, instrument::WithSubscriber}; use tracing_subscriber::{ fmt::{self, time::LocalTime}, EnvFilter, @@ -102,11 +102,16 @@ impl utilities::Utils { } pub fn setup() { + let timer = tracing_subscriber::fmt::time::ChronoLocal::new( + "%Y-%m-%d_%I:%M:%S%.6f %P".to_owned(), + ); tracing_subscriber::FmtSubscriber::builder() .pretty() .with_line_number(true) .with_level(true) .with_target(true) .with_env_filter(EnvFilter::from_default_env()) + .with_target(true) + .with_timer(timer) .init(); }