fixing a lot of debug info
This commit is contained in:
parent
64e10dd765
commit
428386a25b
4 changed files with 72 additions and 40 deletions
|
@ -2,11 +2,14 @@ use std::pin::Pin;
|
|||
|
||||
use time::macros::format_description;
|
||||
use tokio::runtime::Runtime;
|
||||
use tracing::{debug, info};
|
||||
use tracing_subscriber::{
|
||||
fmt::{self, time::LocalTime},
|
||||
EnvFilter,
|
||||
};
|
||||
|
||||
use self::utilities::QString;
|
||||
|
||||
mod db {
|
||||
use diesel::{Connection, SqliteConnection};
|
||||
use dirs::data_local_dir;
|
||||
|
@ -50,6 +53,11 @@ mod db {
|
|||
|
||||
#[cxx_qt::bridge]
|
||||
mod utilities {
|
||||
unsafe extern "C++" {
|
||||
include!("cxx-qt-lib/qstring.h");
|
||||
type QString = cxx_qt_lib::QString;
|
||||
}
|
||||
|
||||
unsafe extern "RustQt" {
|
||||
#[qobject]
|
||||
#[qml_element]
|
||||
|
@ -57,6 +65,12 @@ mod utilities {
|
|||
|
||||
#[qinvokable]
|
||||
fn setup(self: Pin<&mut Utils>);
|
||||
|
||||
#[qinvokable]
|
||||
fn dbg(self: &Utils, message: QString);
|
||||
|
||||
#[qinvokable]
|
||||
fn inf(self: &Utils, message: QString);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,9 +88,17 @@ impl Default for UtilsRust {
|
|||
}
|
||||
|
||||
impl utilities::Utils {
|
||||
pub fn setup(mut self: Pin<&mut Self>) {
|
||||
pub fn setup(self: Pin<&mut Self>) {
|
||||
crate::utils::setup();
|
||||
}
|
||||
|
||||
pub fn dbg(self: &Self, message: QString) {
|
||||
debug!(msg = ?message);
|
||||
}
|
||||
|
||||
pub fn inf(self: &Self, message: QString) {
|
||||
info!(msg = ?message);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn setup() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue