@@ -5,7 +5,7 @@ use crate::{
55use pgt_console:: { ConsoleExt , markup} ;
66use pgt_lsp:: ServerFactory ;
77use pgt_workspace:: { TransportError , WorkspaceError , workspace:: WorkspaceClient } ;
8- use std:: { env, fs , path:: PathBuf } ;
8+ use std:: { env, path:: PathBuf } ;
99use tokio:: io;
1010use tokio:: runtime:: Runtime ;
1111use tracing:: subscriber:: Interest ;
@@ -175,33 +175,6 @@ async fn start_lsp_proxy(
175175 }
176176}
177177
178- pub ( crate ) fn read_most_recent_log_file (
179- log_path : Option < PathBuf > ,
180- log_file_name_prefix : String ,
181- ) -> io:: Result < Option < String > > {
182- let pgt_log_path = log_path. unwrap_or ( default_pgt_log_path ( ) ) ;
183-
184- let most_recent = fs:: read_dir ( pgt_log_path) ?
185- . flatten ( )
186- . filter ( |file| file. file_type ( ) . is_ok_and ( |ty| ty. is_file ( ) ) )
187- . filter_map ( |file| {
188- match file
189- . file_name ( )
190- . to_str ( ) ?
191- . split_once ( log_file_name_prefix. as_str ( ) )
192- {
193- Some ( ( _, date_part) ) if date_part. split ( '-' ) . count ( ) == 4 => Some ( file. path ( ) ) ,
194- _ => None ,
195- }
196- } )
197- . max ( ) ;
198-
199- match most_recent {
200- Some ( file) => Ok ( Some ( fs:: read_to_string ( file) ?) ) ,
201- None => Ok ( None ) ,
202- }
203- }
204-
205178/// Set up the [tracing]-based logging system for the server
206179/// The events received by the subscriber are filtered at the `info` level,
207180/// then printed using the [HierarchicalLayer] layer, and the resulting text
0 commit comments