summaryrefslogtreecommitdiff
path: root/rust-src/bch_bindgen/src/log.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust-src/bch_bindgen/src/log.rs')
-rw-r--r--rust-src/bch_bindgen/src/log.rs57
1 files changed, 0 insertions, 57 deletions
diff --git a/rust-src/bch_bindgen/src/log.rs b/rust-src/bch_bindgen/src/log.rs
deleted file mode 100644
index 32927f16..00000000
--- a/rust-src/bch_bindgen/src/log.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-use std::sync::atomic::{AtomicU8, Ordering};
-
-pub const MUTE: u8 = 0;
-pub const ERROR: u8 = 1;
-pub const INFO: u8 = 2;
-pub const DEBUG: u8 = 3;
-
-// error level by default
-pub static VERBOSE: AtomicU8 = AtomicU8::new(ERROR);
-
-#[inline]
-pub fn set_verbose_level(level: u8) {
- VERBOSE.store(level, Ordering::SeqCst);
-}
-
-pub fn max_level() -> u8 {
- VERBOSE.load(Ordering::SeqCst)
-}
-
-#[macro_export]
-macro_rules! info {
- ($($arg:tt)*) => {
- if 2 <= $crate::log::max_level() {
- println!("{} {} {}",
- " INFO".green(),
- format!("{}:", module_path!()).bright_black(),
- format_args!($($arg)*)
- );
- }
- }
-}
-
-#[macro_export]
-macro_rules! debug {
- ($($arg:tt)*) => {
- if 3 <= $crate::log::max_level() {
- println!("{} {} {}",
- "DEBUG".bright_blue(),
- format!("{}:", module_path!()).bright_black(),
- format_args!($($arg)*)
- );
- }
- }
-}
-
-#[macro_export]
-macro_rules! error {
- ($($arg:tt)*) => {
- if 1 <= $crate::log::max_level() {
- println!("{} {} {}",
- "ERROR".bright_red(),
- format!("{}:", module_path!()).bright_black(),
- format_args!($($arg)*)
- );
- }
- }
-}