From c9579cb9ca2a6a165d10f128e0af1dfd372e0c03 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 21 Mar 2021 20:04:39 +0000 Subject: Implement server (#23) * Add initial database and server setup * Set up all routes, auth, etc * Implement sessions, password auth, hashing with argon2, and history storage --- src/main.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index d47866f4..3c4a05e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,15 @@ extern crate rocket; #[macro_use] extern crate serde_derive; +#[macro_use] +extern crate diesel; + +#[macro_use] +extern crate diesel_migrations; + +#[macro_use] +extern crate rocket_contrib; + use command::AtuinCmd; use local::database::Sqlite; use settings::Settings; @@ -26,6 +35,8 @@ mod local; mod remote; mod settings; +pub mod schema; + #[derive(StructOpt)] #[structopt( author = "Ellie Huxtable ", @@ -61,7 +72,18 @@ impl Atuin { } fn main() -> Result<()> { - pretty_env_logger::init(); + fern::Dispatch::new() + .format(|out, message, record| { + out.finish(format_args!( + "{} [{}] {}", + chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"), + record.level(), + message + )) + }) + .level(log::LevelFilter::Info) + .chain(std::io::stdout()) + .apply()?; Atuin::from_args().run() } -- cgit v1.3.1