Skip to content

Commit 22d7dda

Browse files
committed
🦀 Refactor Workflow Logging to Use Debug Level
Updated the logging in the `Workflow` struct to utilize the `debug!` macro instead of `eprintln!` for improved logging practices. This change enhances the clarity of log messages related to workflow execution, node connections, and default routes, aligning with best practices for structured logging. The adjustments ensure that debug information is captured in a more consistent and manageable manner, facilitating better monitoring and troubleshooting during workflow execution.
1 parent 6f6d5e0 commit 22d7dda

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

crates/floxide-core/src/workflow.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,17 @@ where
140140
let mut visit_counts = HashMap::new();
141141

142142
info!(start_node = %current_node_id, "Starting workflow execution");
143-
eprintln!("Starting workflow execution from node: {}", current_node_id);
143+
debug!(node = %current_node_id, "Starting workflow execution from node");
144144

145145
// Debug info for connections
146-
eprintln!("Node connections:");
146+
debug!("Node connections:");
147147
for ((from, action), to) in &self.edges {
148-
eprintln!(" {} -[{:?}]-> {}", from, action, to);
148+
debug!(from = %from, action = ?action, to = %to, "Connection");
149149
}
150150

151-
eprintln!("Default routes:");
151+
debug!("Default routes:");
152152
for (from, to) in &self.default_routes {
153-
eprintln!(" {} -> {}", from, to);
153+
debug!(from = %from, to = %to, "Default route");
154154
}
155155

156156
loop {
@@ -198,18 +198,12 @@ where
198198
match &outcome {
199199
NodeOutcome::Success(_) => {
200200
info!(node_id = %current_node_id, "Node completed successfully with Success outcome");
201-
eprintln!("Node {} completed with Success outcome", current_node_id);
202201
}
203202
NodeOutcome::Skipped => {
204203
info!(node_id = %current_node_id, "Node completed with Skipped outcome");
205-
eprintln!("Node {} completed with Skipped outcome", current_node_id);
206204
}
207205
NodeOutcome::RouteToAction(action) => {
208-
info!(node_id = %current_node_id, action = %action.name(), "Node completed with RouteToAction outcome");
209-
eprintln!(
210-
"Node {} completed with RouteToAction({:?}) outcome",
211-
current_node_id, action
212-
);
206+
info!(node_id = %current_node_id, action = %action.name(), action_debug = ?action, "Node completed with RouteToAction outcome");
213207
}
214208
}
215209

0 commit comments

Comments
 (0)