aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 80c5b1e..2e08495 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,10 @@
#[macro_use]
extern crate anyhow;
-use log::*;
use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Instant;
+use tracing::*;
use futures::{FutureExt, TryFutureExt};
use std::net::SocketAddr;
@@ -118,7 +118,10 @@ async fn main() {
if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", "tricot=info")
}
- pretty_env_logger::init();
+ tracing_subscriber::fmt()
+ .with_writer(std::io::stderr)
+ .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env())
+ .init();
// Abort on panic (same behavior as in Go)
std::panic::set_hook(Box::new(|panic_info| {
@@ -241,7 +244,10 @@ async fn dump_config_on_change(
.push(ent);
}
- println!("---- PROXY CONFIGURATION ----");
+ println!(
+ "---- PROXY CONFIGURATION at {} ----",
+ chrono::offset::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true)
+ );
for ((host, prefix), ents) in cfg_map.iter_mut() {
println!("{}{}:", host, prefix.as_deref().unwrap_or_default());
for ent in ents.iter() {