about summary refs log tree commit diff stats
path: root/src/db.rs
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-05-26 19:43:37 -0400
committerBen Morrison <ben@gbmor.dev>2020-05-26 19:43:37 -0400
commitc5ea65393d9b8000d68cf8c2f887f22bdae81222 (patch)
tree4a044312814ce7b70c6d9af0a7e32b3860ee9425 /src/db.rs
parenta24e25977e713fbc5a06778ada4c21202209a598 (diff)
downloadclinte-c5ea65393d9b8000d68cf8c2f887f22bdae81222.tar.gz
logging changes:
Rather than using a new logfile for each invocation, a single logfile
called `/tmp/clinte_$USER.log` will be used, with later invocations
appending to the previous messages.

Also removed some unnecessary `use` statements relating to the `log`
crate and its macros. Leaving the macro calls namespaced to `log::`
makes it clearer what the behavior is.
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/db.rs b/src/db.rs
index 0ad16ca..8ae9f2c 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -1,8 +1,5 @@
 use std::time;
 
-use log::info;
-use rusqlite;
-
 const DB_PATH: &str = "/usr/local/clinte/clinte.db";
 
 #[derive(Debug)]
@@ -21,7 +18,7 @@ pub struct Conn {
 impl Conn {
     pub fn init(path: &str) -> rusqlite::Connection {
         let start = time::Instant::now();
-        info!("Connecting to database");
+        log::info!("Connecting to database");
         let conn = rusqlite::Connection::open_with_flags(
             path,
             rusqlite::OpenFlags::SQLITE_OPEN_FULL_MUTEX
@@ -41,7 +38,7 @@ impl Conn {
         )
         .expect("Could not initialize DB");
 
-        info!(
+        log::info!(
             "Database connection established in {}ms",
             start.elapsed().as_millis()
         );