Skip to content

Commit bdc20fa

Browse files
committed
add debug logs in migrate flow
1 parent 881e409 commit bdc20fa

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

crates/chat-cli/src/cli/migrate.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use serde_json::{
1818
Value,
1919
};
2020
use tokio::fs;
21+
use tracing::debug;
2122

2223
use crate::os::Os;
2324
use crate::util::paths::GlobalPaths;
@@ -43,15 +44,15 @@ impl MigrateArgs {
4344
let _lock = match acquire_migration_lock()? {
4445
Some(lock) => lock,
4546
None => {
46-
println!("Migration already in progress by another process");
47+
debug!("Migration already in progress by another process");
4748
return Ok(ExitCode::SUCCESS);
4849
},
4950
};
5051

5152
let status = detect_migration(os).await?;
5253

5354
if !self.force && matches!(status, MigrationStatus::Completed) {
54-
println!("✓ Migration already completed");
55+
debug!("✓ Migration already completed");
5556
return Ok(ExitCode::SUCCESS);
5657
}
5758

@@ -62,7 +63,7 @@ impl MigrateArgs {
6263
new_settings,
6364
} = status
6465
else {
65-
println!("✓ No migration needed (fresh install)");
66+
debug!("✓ No migration needed (fresh install)");
6667
return Ok(ExitCode::SUCCESS);
6768
};
6869

@@ -83,25 +84,25 @@ impl MigrateArgs {
8384

8485
// Migrate database
8586
let db_result = migrate_database(&old_db, &new_db, self.dry_run).await?;
86-
println!("✓ Database: {}", db_result.message);
87+
debug!("✓ Database: {}", db_result.message);
8788

8889
// Migrate settings
8990
let settings_result = migrate_settings(&old_settings, &new_settings, self.dry_run).await?;
90-
println!("✓ Settings: {}", settings_result.message);
91+
debug!("✓ Settings: {}", settings_result.message);
9192
if !settings_result.transformations.is_empty() {
92-
println!(" Transformations applied:");
93+
debug!(" Transformations applied:");
9394
for t in &settings_result.transformations {
94-
println!(" - {t}");
95+
debug!(" - {t}");
9596
}
9697
}
9798

9899
if !self.dry_run {
99100
os.database = crate::database::Database::new().await?;
100101
os.database.set_kiro_migration_completed()?;
101102

102-
println!("\n✓ Migration completed successfully!");
103+
debug!("\n✓ Migration completed successfully!");
103104
} else {
104-
println!("\n(Dry run - no changes made)");
105+
debug!("\n(Dry run - no changes made)");
105106
}
106107

107108
Ok(ExitCode::SUCCESS)

0 commit comments

Comments
 (0)