Replace println!()s with logging macros

This commit is contained in:
Kitaiti Makoto
2021-01-05 21:41:14 +09:00
parent ee96d2b754
commit becb40544c
7 changed files with 21 additions and 14 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
use crate::{Connection, Error, Result};
use diesel::connection::{Connection as Conn, SimpleConnection};
use tracing::info;
use migrations_internals::{setup_database, MigrationConnection};
use std::path::Path;
@@ -26,7 +27,7 @@ struct ComplexMigration {
impl ComplexMigration {
fn run(&self, conn: &Connection, path: &Path) -> Result<()> {
println!("Running migration {}", self.name);
info!("Running migration {}", self.name);
for step in self.up {
step.run(conn, path)?
}
@@ -34,7 +35,7 @@ impl ComplexMigration {
}
fn revert(&self, conn: &Connection, path: &Path) -> Result<()> {
println!("Reverting migration {}", self.name);
info!("Reverting migration {}", self.name);
for step in self.down {
step.run(conn, path)?
}