|
|
@ -5,6 +5,29 @@ use elseware::login::character::CharacterServerState; |
|
|
|
use elseware::common::mainloop::{login_mainloop, character_mainloop};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let colors = fern::colors::ColoredLevelConfig::new()
|
|
|
|
.error(fern::colors::Color::Red)
|
|
|
|
.warn(fern::colors::Color::Yellow)
|
|
|
|
.info(fern::colors::Color::Green)
|
|
|
|
.debug(fern::colors::Color::White)
|
|
|
|
.trace(fern::colors::Color::BrightBlack);
|
|
|
|
let stdio = fern::Dispatch::new()
|
|
|
|
.level(log::LevelFilter::Debug)
|
|
|
|
.format(move |out, message, record| {
|
|
|
|
out.finish(format_args!(
|
|
|
|
"\x1B[{}m[{}][{}][{}] {}\x1B[0m",
|
|
|
|
colors.get_color(&record.level()).to_fg_str(),
|
|
|
|
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
|
|
|
record.target(),
|
|
|
|
record.level(),
|
|
|
|
message,
|
|
|
|
))
|
|
|
|
})
|
|
|
|
.chain(std::io::stdout());
|
|
|
|
fern::Dispatch::new()
|
|
|
|
.chain(stdio)
|
|
|
|
.apply().unwrap();
|
|
|
|
|
|
|
|
let db_host = std::env::var("DB_HOST").unwrap();
|
|
|
|
let db_username = std::env::var("DB_USERNAME").unwrap();
|
|
|
|
let db_password = std::env::var("DB_PASSWORD").unwrap();
|
|
|
|