fix: use tracing instead of println
This commit is contained in:
parent
3b7e976deb
commit
79ffeafc29
1 changed files with 7 additions and 3 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -12,12 +12,16 @@ mod types;
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
|
let commit_hash: &'static str = env!("COMMIT_HASH");
|
||||||
|
tracing::info!("COMMIT_HASH: {}", commit_hash);
|
||||||
|
|
||||||
let cache = KubeCache::Cache::create().unwrap();
|
let cache = KubeCache::Cache::create().unwrap();
|
||||||
let arcCache = Arc::new(cache);
|
let arcCache = Arc::new(cache);
|
||||||
let commit_hash: &'static str = env!("COMMIT_HASH");
|
tracing::info!("kube api initialized");
|
||||||
println!("COMMIT_HASH: {}", commit_hash);
|
|
||||||
|
|
||||||
let mut listener = TcpListener::bind("0.0.0.0:25565").await.unwrap();
|
let mut listener = TcpListener::bind("0.0.0.0:25565").await.unwrap();
|
||||||
|
tracing::info!("tcp server started");
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let (socket, _) = listener.accept().await.unwrap();
|
let (socket, _) = listener.accept().await.unwrap();
|
||||||
|
|
@ -25,7 +29,7 @@ async fn main() {
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Err(e) = process_socket(socket, acc).await {
|
if let Err(e) = process_socket(socket, acc).await {
|
||||||
eprintln!("ERR: {e:?}");
|
tracing::error!("socket error: {e:?}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue