Migrate to structured logging
This commit is contained in:
1 parent
0367d5001b
commit
0baf6cadf7
13 files changed
+202
-30
No files matched your search
@@ -1,6 +1,7 @@
|
||||
use crate::lang::{CardStatistics, DeckSettings};
|
||||
use rusqlite::{Connection, params};
|
||||
use std::time::Instant;
|
||||
use log::info;
|
||||
|
||||
pub fn load_stats_of_deck(set: &DeckSettings, connection: &Connection) -> Vec<CardStatistics> {
|
||||
let mut stmt = connection
|
||||
@@ -58,7 +59,7 @@ pub fn add_stat_list(stats: &mut [CardStatistics], connection: &mut Connection)
|
||||
stats[index].id = id.into();
|
||||
}
|
||||
|
||||
println!("Added {} cards for {:?}", stats.len(), time.elapsed());
|
||||
info!("Added {} cards for {:?}", stats.len(), time.elapsed());
|
||||
}
|
||||
|
||||
pub fn update_stat_score(stat: &CardStatistics, connection: &Connection) {
|
||||
@@ -70,7 +71,7 @@ pub fn update_stat_score(stat: &CardStatistics, connection: &Connection) {
|
||||
(&stat.score, &stat.last_open.timestamp(), &stat.id),
|
||||
)
|
||||
.unwrap();
|
||||
println!("Updated stat: {}", time.elapsed().as_millis());
|
||||
info!("Updated stat: {}", time.elapsed().as_millis());
|
||||
}
|
||||
|
||||
pub fn delete_stats(stat: &[CardStatistics], connection: &Connection) {
|
||||
|
||||
Reference in new issue
Block a user