Add some nice apache-style logs in release mode
This commit is contained in:
parent
623601e3fe
commit
909da58cce
|
@ -481,6 +481,17 @@ dependencies = [
|
|||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colored"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"lazy_static",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "concurrent-queue"
|
||||
version = "1.2.2"
|
||||
|
@ -629,6 +640,7 @@ dependencies = [
|
|||
"async-std",
|
||||
"chrono",
|
||||
"dotenv",
|
||||
"driftwood",
|
||||
"handlebars",
|
||||
"html-escape",
|
||||
"log",
|
||||
|
@ -647,6 +659,18 @@ version = "0.15.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
|
||||
|
||||
[[package]]
|
||||
name = "driftwood"
|
||||
version = "0.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8350e63de72e060a276aa90e5cc79c6164ac092d37bd696783d22ccee8541eb"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"colored",
|
||||
"size",
|
||||
"tide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.6.1"
|
||||
|
@ -1718,6 +1742,15 @@ dependencies = [
|
|||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "size"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e5021178e8e70579d009fb545932e274ec2dde4c917791c6063d1002bee2a56"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.2"
|
||||
|
|
|
@ -8,6 +8,7 @@ edition = "2018"
|
|||
async-std = { version = "~1.6.0", features = ["attributes"] }
|
||||
chrono = "0.4.15"
|
||||
dotenv = "~0.15.0"
|
||||
driftwood = "~0.0.3"
|
||||
handlebars = { version = "~3.4.0", features = ["dir_source"] }
|
||||
html-escape = "~0.2.6"
|
||||
log = "~0.4.8"
|
||||
|
|
|
@ -582,8 +582,15 @@ async fn main() -> Result<(), tide::Error> {
|
|||
state.register_templates().await;
|
||||
let mut app = tide::with_state(state);
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
info!("Activating RELEASE mode configuration");
|
||||
app.with(driftwood::ApacheCombinedLogger);
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
info!("Activating DEBUG mode configuration");
|
||||
info!("Enabling a very liberal CORS policy for debug purposes");
|
||||
use tide::security::{CorsMiddleware, Origin};
|
||||
let cors = CorsMiddleware::new()
|
||||
|
|
Loading…
Reference in New Issue