Cleaning up log creation#1
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts CLI log/output strings in the ShieldCI Rust orchestrator to simplify console messaging during config load, sandbox launch, scanning, and report generation.
Changes:
- Remove emoji/pictographic prefixes from multiple
println!log lines. - Simplify several status messages during target launch, scanning, and reporting.
- Touch (but provide no shown content for) all-in-one Docker/entrypoint files.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/main.rs | Simplifies and standardizes (partially) console output messages across the main scan flow. |
| entrypoint_allinone.sh | File included in PR context but contents not shown here (currently empty in repo view). |
| Dockerfile.allinone | File included in PR context but contents not shown here (currently empty in repo view). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| async fn execute_mcp_tool_stdio(tool_call: &ToolCall) -> Result<String, Box<dyn std::error::Error>> { | ||
| println!("🤝 Initiating MCP Handshake & Strike: {} on {}", tool_call.tool, tool_call.target); | ||
| println!("Initiating MCP Handshake & Strike: {}", tool_call.tool); |
There was a problem hiding this comment.
The MCP strike log line no longer includes the target being scanned. Including tool_call.target (or a sanitized/shortened version) would make scan output much easier to correlate with later results in attack_trace and in CI logs.
| println!("Initiating MCP Handshake & Strike: {}", tool_call.tool); | |
| println!( | |
| "Initiating MCP Handshake & Strike: tool={} target={}", | |
| tool_call.tool, | |
| tool_call.target | |
| ); |
| let report = generate_report(&attack_trace, &codebase, exploit_found).await; | ||
| fs::write("SHIELD_REPORT.md", &report).expect("Unable to write report"); | ||
| println!("\n--- FINAL REPORT ---\n{}\n✅ Saved to SHIELD_REPORT.md", report); | ||
| println!("\n--- FINAL REPORT ---\n{}\n Saved to SHIELD_REPORT.md", report); |
There was a problem hiding this comment.
The final report message now prints a leading space before “Saved to SHIELD_REPORT.md” ("\n Saved..."), which looks like an accidental formatting artifact in CLI output. Remove the extra space (or restore the prior formatting) so the message renders cleanly.
| println!("\n--- FINAL REPORT ---\n{}\n Saved to SHIELD_REPORT.md", report); | |
| println!("\n--- FINAL REPORT ---\n{}\nSaved to SHIELD_REPORT.md", report); |
| println!("Loaded shieldci.yml configuration"); | ||
| Some(config) | ||
| } else { | ||
| println!("⚠️ No shieldci.yml found, falling back to auto-detection"); | ||
| println!("No shieldci.yml found, falling back to auto-detection"); | ||
| None |
There was a problem hiding this comment.
This change removes emoji/prefixes from some log lines, but the file still prints emojis elsewhere (e.g., the scout and boot messages). If the goal is to “clean up log creation”, consider applying a consistent logging format across the remaining println! calls (either all plain text or all with the same prefixing style).
| } | ||
|
|
||
| println!("🚀 Launching {} server on {}...", config.framework, config.target_url); | ||
| println!("Launching {} server", config.framework); |
There was a problem hiding this comment.
The new launch message no longer includes the target URL/port (it previously logged where the server would be reachable). For troubleshooting it’s helpful to log config.target_url (and/or the run command) along with the framework so users can immediately see what endpoint is expected to come up.
| println!("Launching {} server", config.framework); | |
| println!( | |
| "Launching {} server at {} using: {}", | |
| config.framework, config.target_url, config.run_command | |
| ); |
| println!("Waiting for target to come online"); | ||
| let client = Client::builder().timeout(Duration::from_secs(2)).build().unwrap(); | ||
| for _ in 1..=max_retries { | ||
| if client.get(url).send().await.is_ok() { | ||
| println!("✅ Target is up and responding!"); | ||
| println!("Target is up and responding"); | ||
| return Ok(()); | ||
| } | ||
| sleep(Duration::from_secs(2)).await; | ||
| } | ||
| Err(format!("❌ Target {} failed to respond.", url)) | ||
| Err(format!("Target failed to respond.")) | ||
| } |
There was a problem hiding this comment.
wait_for_target logs and returns an error without including the url, which makes failures harder to diagnose. Consider including the URL (and possibly retry count/timeout) in both the initial log and the returned error string.
| sleep(Duration::from_secs(2)).await; | ||
| } | ||
| Err(format!("❌ Target {} failed to respond.", url)) | ||
| Err(format!("Target failed to respond.")) |
There was a problem hiding this comment.
This now uses format!("Target failed to respond.") with no interpolation, which typically triggers a Clippy warning and adds noise. Prefer returning a plain "...".to_string()/String::from(...) here.
| Err(format!("Target failed to respond.")) | |
| Err("Target failed to respond.".to_string()) |
No description provided.