export macros

This commit is contained in:
Able 2022-02-10 21:40:22 -06:00
parent e80a8927c5
commit cdfe5d0045
2 changed files with 6 additions and 7 deletions

View file

@ -3,5 +3,3 @@ pub mod logger;
pub mod syscalls;
pub use core::*;
use logger::LogLevel;

View file

@ -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::*, *};