use tracing::Level;
#[derive(Debug, Clone, Default)]
pub struct MigrationTracing {
pub plan: Option<Level>,
pub apply: Option<Level>,
pub rollback: Option<Level>,
}
impl MigrationTracing {
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn plan(mut self, level: Level) -> Self {
self.plan = Some(level);
self
}
#[must_use]
pub fn apply(mut self, level: Level) -> Self {
self.apply = Some(level);
self
}
#[must_use]
pub fn rollback(mut self, level: Level) -> Self {
self.rollback = Some(level);
self
}
pub fn dev(self) -> Self {
self.plan(Level::DEBUG)
.apply(Level::DEBUG)
.rollback(Level::DEBUG)
}
}