Skip to content

Commit 8b723ac

Browse files
committed
fix(plugin): 补充 remove 调试日志
1 parent 7954d02 commit 8b723ac

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/cortex-cli/src/plugin_cmd.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,13 @@ async fn run_remove(args: PluginRemoveArgs) -> Result<()> {
11471147
let plugins_dir = get_plugins_dir();
11481148
let plugin_path = plugins_dir.join(&args.name);
11491149

1150+
tracing::debug!(
1151+
plugin = %args.name,
1152+
plugins_dir = %plugins_dir.display(),
1153+
plugin_path = %plugin_path.display(),
1154+
"Preparing to remove plugin"
1155+
);
1156+
11501157
if !plugin_path.exists() {
11511158
bail!("Plugin '{}' is not installed.", args.name);
11521159
}
@@ -1159,12 +1166,14 @@ async fn run_remove(args: PluginRemoveArgs) -> Result<()> {
11591166
let mut input = String::new();
11601167
std::io::stdin().read_line(&mut input)?;
11611168
if !input.trim().eq_ignore_ascii_case("y") {
1169+
tracing::debug!(plugin = %args.name, "Plugin removal aborted by user");
11621170
println!("Aborted.");
11631171
return Ok(());
11641172
}
11651173
}
11661174

11671175
std::fs::remove_dir_all(&plugin_path)?;
1176+
tracing::debug!(plugin = %args.name, "Plugin directory removed successfully");
11681177
println!("Plugin '{}' removed successfully.", args.name);
11691178
Ok(())
11701179
}

0 commit comments

Comments
 (0)