@@ -7,10 +7,10 @@ use clap_complete::generate;
77use dsc_lib:: progress:: ProgressFormat ;
88use mcp:: start_mcp_server;
99use rust_i18n:: { i18n, t} ;
10- use std:: { io , process :: exit } ;
10+ use std:: io ;
1111use sysinfo:: { Process , RefreshKind , System , get_current_pid, ProcessRefreshKind } ;
1212use tracing:: { error, info, warn, debug} ;
13- use util:: flush_and_shutdown_tracing ;
13+ use util:: exit ;
1414
1515use crate :: util:: { EXIT_INVALID_INPUT , get_input} ;
1616
@@ -69,7 +69,6 @@ fn main() {
6969 Ok ( merged) => Some ( merged) ,
7070 Err ( err) => {
7171 error ! ( "{}: {err}" , t!( "main.failedMergingParameters" ) ) ;
72- flush_and_shutdown_tracing ( ) ;
7372 exit ( EXIT_INVALID_INPUT ) ;
7473 }
7574 }
@@ -90,10 +89,8 @@ fn main() {
9089 SubCommand :: Mcp => {
9190 if let Err ( err) = start_mcp_server ( ) {
9291 error ! ( "{}" , t!( "main.failedToStartMcpServer" , error = err) ) ;
93- flush_and_shutdown_tracing ( ) ;
9492 exit ( util:: EXIT_MCP_FAILED ) ;
9593 }
96- flush_and_shutdown_tracing ( ) ;
9794 exit ( util:: EXIT_SUCCESS ) ;
9895 }
9996 SubCommand :: Resource { subcommand } => {
@@ -105,15 +102,13 @@ fn main() {
105102 Ok ( json) => json,
106103 Err ( err) => {
107104 error ! ( "JSON: {err}" ) ;
108- flush_and_shutdown_tracing ( ) ;
109105 exit ( util:: EXIT_JSON_ERROR ) ;
110106 }
111107 } ;
112108 util:: write_object ( & json, output_format. as_ref ( ) , false ) ;
113109 } ,
114110 }
115111
116- flush_and_shutdown_tracing ( ) ;
117112 exit ( util:: EXIT_SUCCESS ) ;
118113}
119114
@@ -125,18 +120,15 @@ fn ctrlc_handler() {
125120 info ! ( "{}: {}" , t!( "main.foundProcesses" ) , sys. processes( ) . len( ) ) ;
126121 let Ok ( current_pid) = get_current_pid ( ) else {
127122 error ! ( "{}" , t!( "main.failedToGetPid" ) ) ;
128- flush_and_shutdown_tracing ( ) ;
129123 exit ( util:: EXIT_CTRL_C ) ;
130124 } ;
131125 info ! ( "{}: {}" , t!( "main.currentPid" ) , current_pid) ;
132126 let Some ( current_process) = sys. process ( current_pid) else {
133127 error ! ( "{}" , t!( "main.failedToGetProcess" ) ) ;
134- flush_and_shutdown_tracing ( ) ;
135128 exit ( util:: EXIT_CTRL_C ) ;
136129 } ;
137130
138131 terminate_subprocesses ( & sys, current_process) ;
139- flush_and_shutdown_tracing ( ) ;
140132 exit ( util:: EXIT_CTRL_C ) ;
141133}
142134
@@ -201,7 +193,6 @@ fn check_store() {
201193 eprintln ! ( "{}" , t!( "main.storeMessage" ) ) ;
202194 // wait for keypress
203195 let _ = io:: stdin ( ) . read ( & mut [ 0u8 ] ) . unwrap ( ) ;
204- flush_and_shutdown_tracing ( ) ;
205196 exit ( util:: EXIT_INVALID_ARGS ) ;
206197 }
207198}
0 commit comments