From cdfe5d004503f5c35fede027fbbe0bd9b4c57abd Mon Sep 17 00:00:00 2001 From: Able Date: Thu, 10 Feb 2022 21:40:22 -0600 Subject: [PATCH] export macros --- src/lib.rs | 2 -- src/logger/mod.rs | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ca32d84..9c4ee35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,5 +3,3 @@ pub mod logger; pub mod syscalls; pub use core::*; - -use logger::LogLevel; diff --git a/src/logger/mod.rs b/src/logger/mod.rs index fe4aca1..8f0d077 100644 --- a/src/logger/mod.rs +++ b/src/logger/mod.rs @@ -12,7 +12,7 @@ pub enum LogLevel { extern "C" { pub fn host_log(log_level: LogLevel, log_message: *const u8, log_message_len: u32); } - +#[macro_export] macro_rules! log { ($a:expr, $b:expr) => {{ let log_level: LogLevel = $a; @@ -25,6 +25,7 @@ macro_rules! log { } }}; } +#[macro_export] macro_rules! debug { ($a:expr) => { @@ -33,7 +34,7 @@ macro_rules! debug { log!(Debug, $a); }; } - +#[macro_export] macro_rules! error { ($a:expr) => { use crate::logger::{LogLevel::*, *}; @@ -41,7 +42,7 @@ macro_rules! error { log!(Error, $a); }; } - +#[macro_export] macro_rules! trace { ($a:expr) => { use crate::logger::*; @@ -49,7 +50,7 @@ macro_rules! trace { log!(Trace, $a); }; } - +#[macro_export] macro_rules! warn { ($a:expr) => { use crate::logger::{LogLevel::*, *}; @@ -57,7 +58,7 @@ macro_rules! warn { log!(Warn, $a); }; } - +#[macro_export] macro_rules! info { ($a:expr) => { use crate::logger::{LogLevel::*, *};