Skip to content

Commit

Permalink
Change println! to debug! (LemmyNet#5346)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic authored Jan 23, 2025
1 parent ed55a25 commit 8ee81a3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/db_schema/src/schema_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use diesel::{
use diesel_migrations::MigrationHarness;
use lemmy_utils::{error::LemmyResult, settings::SETTINGS};
use std::time::Instant;
use tracing::log::debug;

diesel::table! {
pg_namespace (nspname) {
Expand Down Expand Up @@ -66,7 +67,7 @@ impl MigrationHarnessWrapper<'_> {
.map(|d| d.to_string())
.unwrap_or_default();
let name = migration.name();
println!("{duration} run {name}");
debug!("{duration} run {name}");

result
}
Expand Down Expand Up @@ -111,7 +112,7 @@ impl MigrationHarness<Pg> for MigrationHarnessWrapper<'_> {
.map(|d| d.to_string())
.unwrap_or_default();
let name = migration.name();
println!("{duration} revert {name}");
debug!("{duration} revert {name}");

result
}
Expand Down Expand Up @@ -191,9 +192,9 @@ pub fn run(options: Options) -> LemmyResult<Branch> {

// Block concurrent attempts to run migrations until `conn` is closed, and disable the
// trigger that prevents the Diesel CLI from running migrations
println!("Waiting for lock...");
debug!("Waiting for lock...");
conn.batch_execute("SELECT pg_advisory_lock(0);")?;
println!("Running Database migrations (This may take a long time)...");
debug!("Running Database migrations (This may take a long time)...");

// Drop `r` schema, so migrations don't need to be made to work both with and without things in
// it existing
Expand Down Expand Up @@ -226,7 +227,7 @@ pub fn run(options: Options) -> LemmyResult<Branch> {
Branch::ReplaceableSchemaNotRebuilt
};

println!("Database migrations complete.");
debug!("Database migrations complete.");

Ok(output)
}
Expand Down

0 comments on commit 8ee81a3

Please sign in to comment.