diff --git a/Scarb.lock b/Scarb.lock index 1a805240..bcd979eb 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -12,7 +12,6 @@ dependencies = [ name = "consensus" version = "0.1.0" dependencies = [ - "logging", "logging_macros", "utils", ] diff --git a/packages/consensus/Scarb.toml b/packages/consensus/Scarb.toml index 2cd24a8a..b1b916be 100644 --- a/packages/consensus/Scarb.toml +++ b/packages/consensus/Scarb.toml @@ -11,7 +11,7 @@ log_level_debug = [] [dependencies] utils = { path = "../utils" } -logging = { path = "../logging" } +# logging = { path = "../logging" } logging_macros = { path = "../logging_macros" } [dev-dependencies] diff --git a/packages/consensus/src/logging.cairo b/packages/consensus/src/logging.cairo index dd9f443c..35fe6f4f 100644 --- a/packages/consensus/src/logging.cairo +++ b/packages/consensus/src/logging.cairo @@ -1,12 +1,33 @@ +#[cfg(feature: 'log_level_trace')] +mod log_levels { + pub const LOG_LEVEL_TRACE: bool = true; + pub const LOG_LEVEL_DEBUG: bool = true; +} + +#[cfg(feature: 'log_level_debug')] +mod log_levels { + pub const LOG_LEVEL_TRACE: bool = false; + pub const LOG_LEVEL_DEBUG: bool = true; +} + +#[cfg(feature: 'log_level_none')] +mod log_levels { + pub const LOG_LEVEL_TRACE: bool = false; + pub const LOG_LEVEL_DEBUG: bool = false; +} + +pub use log_levels::LOG_LEVEL_TRACE; +pub use log_levels::LOG_LEVEL_DEBUG; + #[cfg(test)] mod tests { - use logging::ABC; - use logging::LOG_LEVEL_DEBUG; #[test] - fn test_log_level_debug() {// log!("DEBUG", "log! works"); + fn test_log_level_debug() { + log!("DEBUG", "log! works"); } #[test] - fn test_log_level_trace() {// log!("DEBUG", "log! works"); + fn test_log_level_trace() { + log!("DEBUG", "log! works"); } }