Skip to content

Commit

Permalink
refactor(hsh): ➖ remove loggers functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed May 11, 2024
1 parent 6f3eb91 commit eed1bc5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 411 deletions.
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@
/// The `algorithms` module contains the password hashing algorithms.
pub mod algorithms;

/// The `loggers` module contains the loggers for the library.
pub mod loggers;

/// The `macros` module contains functions for generating macros.
pub mod macros;

Expand Down
243 changes: 0 additions & 243 deletions src/loggers.rs

This file was deleted.

36 changes: 0 additions & 36 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,42 +434,6 @@ macro_rules! hash_length {
};
}

/// Custom logging macro for various log levels and formats.
///
/// # Parameters
///
/// * `$level`: The log level of the message.
/// * `$component`: The component where the log is coming from.
/// * `$description`: A description of the log message.
/// * `$format`: The format of the log message.
///
#[macro_export]
macro_rules! macro_log_info {
($level:expr, $component:expr, $description:expr, $format:expr) => {{
use dtt::DateTime;
use vrd::random::Random;
use $crate::loggers::{Log, LogFormat, LogLevel};

// Get the current date and time in ISO 8601 format.
let date = DateTime::new();
let iso = date.iso_8601;

// Create a new random number generator
let mut rng = Random::default();
let session_id = rng.rand().to_string();

let log = Log::new(
&session_id,
&iso,
$level,
$component,
$description,
$format,
);
let _ = log.log();
}};
}

/// Macros related to executing shell commands.
///
/// Executes a shell command, logs the start and completion of the operation, and handles any errors that occur.
Expand Down
Loading

0 comments on commit eed1bc5

Please sign in to comment.