diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-03-21 20:04:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-21 20:04:39 +0000 |
| commit | c9579cb9ca2a6a165d10f128e0af1dfd372e0c03 (patch) | |
| tree | 1d4feecb422aae3cde1cc7cad54ccc73b2dae410 /src/main.rs | |
| parent | Add TUI, resolve #19, #17, #16 (#21) (diff) | |
| download | atuin-c9579cb9ca2a6a165d10f128e0af1dfd372e0c03.zip | |
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
Diffstat (limited to '')
| -rw-r--r-- | src/main.rs | 24 |
1 files changed, 23 insertions, 1 deletions
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 <e@elm.sh>", @@ -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() } |
