Skip to content

Commit 051d53b

Browse files
committed
refactor: remove Logger module
The module occurrences and usage was already replaced in previous commits, so it's possible to remove the whole module. Signed-off-by: Lorenzo Bertin Salvador <lorenzobs@usp.br>
1 parent 594771e commit 051d53b

5 files changed

Lines changed: 3 additions & 311 deletions

File tree

src/app/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use tracing::{event, Level};
1111
use std::collections::{HashMap, HashSet};
1212

1313
use crate::{
14-
infrastructure::{logging::Logger, monitoring::logging::garbage_collector::collect_garbage},
14+
infrastructure::monitoring::logging::garbage_collector::collect_garbage,
1515
log_on_error,
1616
lore::{
1717
lore_api_client::BlockingLoreAPIClient,
@@ -60,8 +60,7 @@ pub struct App {
6060
impl App {
6161
/// Creates a new instance of `App`. It dynamically loads configurations
6262
/// based on precedence (see [crate::app::Config::build]), app data
63-
/// (available mailing lists, bookmarked patchsets, reviewed patchsets), and
64-
/// initializes the Logger (see [crate::app::logging::Logger])
63+
/// (available mailing lists, bookmarked patchsets, reviewed patchsets)
6564
///
6665
/// # Returns
6766
///
@@ -80,9 +79,6 @@ impl App {
8079

8180
let lore_api_client = BlockingLoreAPIClient::default();
8281

83-
// Initialize the logger before the app starts
84-
Logger::init_log_file(&config)?;
85-
8682
event!(Level::INFO, "patch-hub started");
8783
collect_garbage(&config);
8884

src/infrastructure/errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::panic;
22

3-
use super::{logging::Logger, terminal::restore};
3+
use super::terminal::restore;
44

55
/// This replaces the standard color_eyre panic and error hooks with hooks that
66
/// restore the terminal before printing the panic or error.
@@ -11,7 +11,6 @@ pub fn install_hooks() -> color_eyre::Result<()> {
1111
let panic_hook = panic_hook.into_panic_hook();
1212
panic::set_hook(Box::new(move |panic_info| {
1313
restore().unwrap();
14-
Logger::flush();
1514
panic_hook(panic_info);
1615
}));
1716

src/infrastructure/logging/mod.rs

Lines changed: 0 additions & 299 deletions
This file was deleted.

src/infrastructure/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pub mod errors;
2-
pub mod logging;
32
pub mod monitoring;
43
pub mod terminal;

src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use cli::Cli;
1212
use color_eyre::eyre::bail;
1313
use handler::run_app;
1414
use infrastructure::{
15-
logging::Logger,
1615
monitoring::{init_monitoring, InitMonitoringProduct},
1716
terminal::{init, restore},
1817
};
@@ -62,7 +61,5 @@ fn main() -> color_eyre::Result<()> {
6261

6362
event!(Level::INFO, "patch-hub finished");
6463

65-
Logger::flush();
66-
6764
Ok(())
6865
}

0 commit comments

Comments
 (0)