File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,14 @@ use crate::server_recv_thread::server_recv_thread;
1414use crate :: shared_state:: SharedState ;
1515use crate :: utils:: { refresh_connection_frontend, refresh_loggingbar} ;
1616
17- pub ( crate ) fn attach_console ( ) {
18- #[ cfg( target_os = "windows" ) ]
19- {
20- use windows:: Win32 :: System :: Console :: AttachConsole ;
21- unsafe {
22- AttachConsole ( u32:: MAX ) . as_bool ( ) ;
17+ pub fn attach_console ( ) {
18+ if std:: env:: var ( "SWIFTNAV_CONSOLE_DEBUG" ) . is_ok ( ) {
19+ #[ cfg( target_os = "windows" ) ]
20+ {
21+ use windows:: Win32 :: System :: Console :: AttachConsole ;
22+ unsafe {
23+ AttachConsole ( u32:: MAX ) . as_bool ( ) ;
24+ }
2325 }
2426 }
2527}
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ lazy_static! {
2222
2323#[ cfg( feature = "entrypoint" ) ]
2424pub fn attach_console ( ) {
25- #[ cfg( target_os = "windows" ) ]
26- {
27- use windows:: Win32 :: System :: Console :: AttachConsole ;
28- unsafe {
29- AttachConsole ( u32:: MAX ) . as_bool ( ) ;
25+ if std:: env:: var ( "SWIFTNAV_CONSOLE_DEBUG" ) . is_ok ( ) {
26+ #[ cfg( target_os = "windows" ) ]
27+ {
28+ use windows:: Win32 :: System :: Console :: AttachConsole ;
29+ unsafe {
30+ AttachConsole ( u32:: MAX ) . as_bool ( ) ;
31+ }
3032 }
3133 }
3234}
You can’t perform that action at this time.
0 commit comments