start to adding logs

This commit is contained in:
2023-05-23 21:56:51 +02:00
parent d61bd044a4
commit 276af0ba97
8 changed files with 217 additions and 15 deletions

View File

@@ -3,6 +3,7 @@ use crate::server_conf::conexion::Conexion;
use crate::server_conf::listener::GenericListener;
use std::thread;
use std::sync::{Arc, RwLock};
use log::{error,info};
pub struct ConfSer{
path: String,
@@ -23,7 +24,7 @@ impl Drop for ConfSer {
fn drop(&mut self) {
// There's no way to return a useful error here
let _ = std::fs::remove_file(self.path.clone()).unwrap();
println!("> Dropping {}", self.path);
info!("> Dropping {}", self.path);
}
}
@@ -37,7 +38,7 @@ pub fn start(conf: Arc<RwLock<conf::Config>>){
let c = conf.clone();
thread::spawn(|| Conexion::new(c, stream).process_reques());
}
Err(e) => println!("{}", e)
Err(e) => error!("{}", e)
}
}