@@ -9,6 +9,8 @@ use log::{info, LevelFilter, trace};
99use serde:: Deserialize ;
1010use serde_json:: Value ;
1111use tokio:: runtime:: { Builder , Runtime } ;
12+ use std:: io:: Write ;
13+ use crate :: config:: time:: current_formatted_time;
1214
1315pub mod time;
1416
@@ -75,7 +77,13 @@ pub fn init_runtime () -> std::io::Result<Runtime> {
7577
7678pub fn init_configs ( config_path : Option < & String > ) -> std:: io:: Result < ( ) > {
7779 //init logger
78- env_logger:: builder ( ) . filter_level ( LevelFilter :: Info ) . init ( ) ;
80+ env_logger:: builder ( )
81+ . format ( |buf, rec| {
82+ let style = buf. default_level_style ( rec. level ( ) ) ;
83+ writeln ! ( buf, "[{} {style}{}{style:#} librespeed_rs] {}" , current_formatted_time( ) , rec. level( ) , rec. args( ) )
84+ } )
85+ . filter_level ( LevelFilter :: Info ) . init ( ) ;
86+ println ! ( "{HEAD_ART}" ) ;
7987 //find server configs
8088 match config_path {
8189 Some ( config_path) => {
@@ -190,4 +198,12 @@ pub static ROUTES: OnceLock<HashMap<String,&str>> = OnceLock::new();
190198pub static GARBAGE_DATA : OnceLock < Vec < u8 > > = OnceLock :: new ( ) ;
191199pub static SERVER_CONFIG : OnceLock < ServerConfig > = OnceLock :: new ( ) ;
192200pub static FONT : OnceLock < FontRef > = OnceLock :: new ( ) ;
193- pub static DEF_ASSETS : Dir = include_dir ! ( "assets" ) ;
201+ pub static DEF_ASSETS : Dir = include_dir ! ( "assets" ) ;
202+ pub const HEAD_ART : & str = r#"
203+ _ _ _ _
204+ | (_) |__ _ __ ___ ___ _ __ ___ ___ __| | _ __ ___
205+ | | | '_ \| '__/ _ \/ __| '_ \ / _ \/ _ \/ _` |_____| '__/ __|
206+ | | | |_) | | | __/\__ \ |_) | __/ __/ (_| |_____| | \__ \
207+ |_|_|_.__/|_| \___||___/ .__/ \___|\___|\__,_| |_| |___/
208+ |_|
209+ "# ;
0 commit comments