MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / try_debug

Method try_debug

crates/firewheel-core/src/log.rs:136–160  ·  view source on GitHub ↗
(&mut self, message: &str)

Source from the content-addressed store, hash-verified

134 /// This will do nothing when compiled without debug assertions.
135 #[allow(unused)]
136 pub fn try_debug(&mut self, message: &str) -> Result<(), RealtimeLogError> {
137 #[cfg(debug_assertions)]
138 {
139 if message.len() > self.max_msg_length {
140 self.shared_state
141 .message_too_long_occurred
142 .store(true, Ordering::Relaxed);
143 return Err(RealtimeLogError::MessageTooLong);
144 }
145
146 let Some(mut slot) = self.debug_cons.try_pop() else {
147 self.shared_state
148 .not_enough_slots_occurred
149 .store(true, Ordering::Relaxed);
150 return Err(RealtimeLogError::OutOfSlots);
151 };
152
153 slot.clear();
154 slot.push_str(message);
155
156 let _ = self.debug_prod.try_push(slot);
157 }
158
159 Ok(())
160 }
161
162 /// Log a debug message into the given string.
163 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected