MCPcopy Create free account
hub / github.com/PowerShell/DSC / check_debug

Function check_debug

resources/registry/src/main.rs:164–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162
163#[cfg(debug_assertions)]
164fn check_debug() {
165 if env::var("DEBUG_REGISTRY").is_ok() {
166 eprintln!("{}", t!("main.debugAttach", pid = std::process::id()));
167
168 loop {
169 let event = match event::read() {
170 Ok(event) => event,
171 Err(err) => {
172 eprintln!("{}", t!("main.debugEventReadError", "err" => err));
173 break;
174 }
175 };
176 if let event::Event::Key(key) = event {
177 // workaround bug in 0.26+ https://github.com/crossterm-rs/crossterm/issues/752#issuecomment-1414909095
178 if key.kind == event::KeyEventKind::Press {
179 break;
180 }
181 } else {
182 eprintln!("{}", t!("main.debugEventUnexpectedError", e = event : {:?}));
183 }
184 }
185 }
186}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected