99
1010use log:: { Level , LevelFilter , Log , Metadata , Record } ;
1111use std:: fs:: { self , File , OpenOptions } ;
12- use std:: io:: { self , BufWriter , Write } ;
12+ use std:: io:: { self , Write } ;
1313use std:: path:: { Path , PathBuf } ;
1414use std:: sync:: { Arc , Mutex } ;
1515
@@ -29,7 +29,7 @@ pub struct ServerLogger {
2929 /// The maximum log level to display
3030 level : LevelFilter ,
3131 /// The file to write logs to, protected by a mutex for thread-safe access
32- file : Mutex < BufWriter < File > > ,
32+ file : Mutex < File > ,
3333 /// Path to the log file for reopening on SIGHUP
3434 log_file_path : PathBuf ,
3535}
@@ -155,9 +155,8 @@ fn format_level(level: Level) -> &'static str {
155155 }
156156}
157157
158- fn open_log_file ( log_file_path : & Path ) -> Result < BufWriter < File > , io:: Error > {
159- let file = OpenOptions :: new ( ) . create ( true ) . append ( true ) . open ( log_file_path) ?;
160- Ok ( BufWriter :: new ( file) )
158+ fn open_log_file ( log_file_path : & Path ) -> Result < File , io:: Error > {
159+ OpenOptions :: new ( ) . create ( true ) . append ( true ) . open ( log_file_path)
161160}
162161
163162/// Wrapper to allow Arc<ServerLogger> to implement Log trait
0 commit comments