From 0d5ec3626773edb7d32884c594230c7cc03ae0e7 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 2 Jun 2024 12:53:20 +0200 Subject: Simplify logging init --- src/db/payments.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/db/payments.rs') diff --git a/src/db/payments.rs b/src/db/payments.rs index bebc69d..b415a28 100644 --- a/src/db/payments.rs +++ b/src/db/payments.rs @@ -82,7 +82,7 @@ WHERE match res { Ok(count) => count, Err(err) => { - error!("Error counting payments: {:?}", err); + log::error!("Error counting payments: {:?}", err); Count { count: 0, total_cost: 0, @@ -169,7 +169,7 @@ OFFSET ? match res { Ok(payments) => payments, Err(err) => { - error!("Error listing payments: {:?}", err); + log::error!("Error listing payments: {:?}", err); vec![] } } @@ -308,7 +308,7 @@ GROUP BY match result { Ok(payments) => payments, Err(err) => { - error!("Error listing payments for statistics: {:?}", err); + log::error!("Error listing payments for statistics: {:?}", err); vec![] } } @@ -342,7 +342,7 @@ WHERE match res { Ok(count) => count, Err(err) => { - error!("Error getting payment row: {:?}", err); + log::error!("Error getting payment row: {:?}", err); 1 } } @@ -373,7 +373,7 @@ WHERE match res { Ok(p) => Some(p), Err(err) => { - error!("Error looking for payment {}: {:?}", id, err); + log::error!("Error looking for payment {}: {:?}", id, err); None } } @@ -400,7 +400,7 @@ VALUES match res { Ok(x) => Some(x.last_insert_rowid()), Err(err) => { - error!("Error creating payment: {:?}", err); + log::error!("Error creating payment: {:?}", err); None } } @@ -434,7 +434,7 @@ WHERE match res { Ok(_) => true, Err(err) => { - error!("Error updating payment {}: {:?}", id, err); + log::error!("Error updating payment {}: {:?}", id, err); false } } @@ -458,7 +458,7 @@ WHERE match res { Ok(_) => true, Err(err) => { - error!("Error deleting payment {}: {:?}", id, err); + log::error!("Error deleting payment {}: {:?}", id, err); false } } @@ -493,7 +493,7 @@ ORDER BY Ok(category) => Some(category), Err(Error::RowNotFound) => None, Err(err) => { - error!( + log::error!( "Error looking for the category of {}: {:?}", payment_name, err ); @@ -521,7 +521,7 @@ LIMIT Ok(_) => true, Err(Error::RowNotFound) => false, Err(err) => { - error!( + log::error!( "Error looking if category {} is used: {:?}", category_id, err ); @@ -560,7 +560,7 @@ ON match res { Ok(costs) => HashMap::from_iter(costs), Err(err) => { - error!("Error getting payments repartition: {:?}", err); + log::error!("Error getting payments repartition: {:?}", err); HashMap::new() } } @@ -588,7 +588,7 @@ WHERE match res { Ok(_) => (), - Err(err) => error!("Error creating monthly payments: {:?}", err), + Err(err) => log::error!("Error creating monthly payments: {:?}", err), } } @@ -640,7 +640,7 @@ ORDER BY match res { Ok(payments) => payments, Err(err) => { - error!("Error listing payments for report: {:?}", err); + log::error!("Error listing payments for report: {:?}", err); vec![] } } -- cgit v1.2.3