use log and env_logger, and add some logging around sync

This commit is contained in:
Dustin J. Mitchell
2020-11-29 18:18:28 -05:00
parent c117494ce6
commit 0a1ee470f7
13 changed files with 109 additions and 14 deletions

View File

@@ -27,6 +27,7 @@ pub(crate) fn app_scope(server_state: ServerState) -> Scope {
#[actix_web::main]
async fn main() -> Fallible<()> {
env_logger::init();
let matches = clap::App::new("taskchampion-sync-server")
.version("0.1.0")
.about("Server for TaskChampion")
@@ -58,7 +59,7 @@ async fn main() -> Fallible<()> {
let server_box: Box<dyn Storage> = Box::new(KVStorage::new(data_dir)?);
let server_state = ServerState::new(server_box);
println!("Serving on port {}", port);
log::warn!("Serving on port {}", port);
HttpServer::new(move || App::new().service(app_scope(server_state.clone())))
.bind(format!("0.0.0.0:{}", port))?
.run()