diff options
author | Ben Morrison <ben@gbmor.dev> | 2020-05-26 19:43:37 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2020-05-26 19:43:37 -0400 |
commit | c5ea65393d9b8000d68cf8c2f887f22bdae81222 (patch) | |
tree | 4a044312814ce7b70c6d9af0a7e32b3860ee9425 /src/main.rs | |
parent | a24e25977e713fbc5a06778ada4c21202209a598 (diff) | |
download | clinte-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/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index e2f793b..faef1b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ use std::time; extern crate lazy_static; use clap; -use log::info; mod db; mod ed; @@ -25,17 +24,17 @@ fn main() -> error::Result<()> { let start = time::Instant::now(); logging::init()?; - info!("clinte starting up!"); + log::info!("clinte starting up!"); println!("clinte v{}", clap::crate_version!()); println!("a community notices system"); println!(); let db = db::Conn::new(); - info!("Startup completed in {:?}ms", start.elapsed().as_millis()); + log::info!("Startup completed in {:?}ms", start.elapsed().as_millis()); if arg_matches.subcommand_matches("post").is_some() { - info!("New post..."); + log::info!("New post..."); posts::create(&db)?; } else if arg_matches.subcommand_matches("update").is_some() { let id: u32 = if let Some(val) = arg_matches.subcommand_matches("update_handler") { @@ -43,7 +42,7 @@ fn main() -> error::Result<()> { } else { 0 }; - info!("Updating post ..."); + log::info!("Updating post ..."); posts::update_handler(&db, id)?; } else if arg_matches.subcommand_matches("delete").is_some() { let id: u32 = if let Some(val) = arg_matches.subcommand_matches("update_handler") { @@ -51,7 +50,7 @@ fn main() -> error::Result<()> { } else { 0 }; - info!("Deleting post"); + log::info!("Deleting post"); posts::delete_handler(&db, id)?; } |