Skip to content

Commit

Permalink
Add basic logging
Browse files Browse the repository at this point in the history
- added basic logging, similar to autumn
  • Loading branch information
brecert committed Sep 20, 2021
1 parent 8c10210 commit 2836a43
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ serde_json = "1"
mime = "0.3.16"
serde = "1"
regex = "1"
log = "0.4.14"
env_logger = "0.8.4"
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#[macro_use]
extern crate lazy_static;

use actix_web::middleware::Logger;
use actix_web::{web, App, HttpServer};
use log::info;
use util::variables::HOST;

pub mod routes;
Expand All @@ -10,8 +12,13 @@ pub mod util;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info"));

info!("Starting January server.");

HttpServer::new(|| {
App::new()
.wrap(Logger::default())
.route("/", web::get().to(routes::info::get))
.route("/embed", web::get().to(routes::embed::get))
.route("/proxy", web::get().to(routes::proxy::get))
Expand Down

0 comments on commit 2836a43

Please sign in to comment.