Beggin to log
This commit is contained in:
parent
bd638e3d23
commit
e4d838d1fe
|
@ -5,3 +5,4 @@
|
|||
Cargo.lock
|
||||
Conf.toml
|
||||
/data
|
||||
/log
|
|
@ -21,3 +21,5 @@ tokio = { version = "0.2", features = ["full"] }
|
|||
futures = "0.3"
|
||||
chrono = "0.4.15"
|
||||
serde_json = "1.0"
|
||||
log = "0.4"
|
||||
log4rs = "0.13.0"
|
|
@ -0,0 +1,12 @@
|
|||
appenders:
|
||||
stdout:
|
||||
kind: console
|
||||
file-debug:
|
||||
kind: file
|
||||
path: "log/debug.log"
|
||||
encoder:
|
||||
pattern: "{d} - {m}{n}"
|
||||
root:
|
||||
level: debug
|
||||
appenders:
|
||||
- stdout
|
|
@ -2,7 +2,7 @@
|
|||
macro_rules! debugln {
|
||||
($($arg:tt)*) => {
|
||||
if cfg!(debug_assertions) {
|
||||
eprintln!($($arg)*);
|
||||
log::debug!($($arg)*);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ impl TypeMapKey for ShardManagerContainer {
|
|||
// TODO USE LOG
|
||||
#[tokio::main]
|
||||
async fn main() -> IoResult<()> {
|
||||
log4rs::init_file("log4rs.yaml", Default::default()).unwrap();
|
||||
let conf: config::Conf = toml::from_str(&std::fs::read_to_string("Conf.toml")?)?;
|
||||
debugln!("conf : {:?}", conf);
|
||||
|
||||
|
|
Loading…
Reference in New Issue