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 mod syscalls;
pub use core::*; pub use core::*;
use logger::LogLevel;

View file

@ -12,7 +12,7 @@ pub enum LogLevel {
extern "C" { extern "C" {
pub fn host_log(log_level: LogLevel, log_message: *const u8, log_message_len: u32); pub fn host_log(log_level: LogLevel, log_message: *const u8, log_message_len: u32);
} }
#[macro_export]
macro_rules! log { macro_rules! log {
($a:expr, $b:expr) => {{ ($a:expr, $b:expr) => {{
let log_level: LogLevel = $a; let log_level: LogLevel = $a;
@ -25,6 +25,7 @@ macro_rules! log {
} }
}}; }};
} }
#[macro_export]
macro_rules! debug { macro_rules! debug {
($a:expr) => { ($a:expr) => {
@ -33,7 +34,7 @@ macro_rules! debug {
log!(Debug, $a); log!(Debug, $a);
}; };
} }
#[macro_export]
macro_rules! error { macro_rules! error {
($a:expr) => { ($a:expr) => {
use crate::logger::{LogLevel::*, *}; use crate::logger::{LogLevel::*, *};
@ -41,7 +42,7 @@ macro_rules! error {
log!(Error, $a); log!(Error, $a);
}; };
} }
#[macro_export]
macro_rules! trace { macro_rules! trace {
($a:expr) => { ($a:expr) => {
use crate::logger::*; use crate::logger::*;
@ -49,7 +50,7 @@ macro_rules! trace {
log!(Trace, $a); log!(Trace, $a);
}; };
} }
#[macro_export]
macro_rules! warn { macro_rules! warn {
($a:expr) => { ($a:expr) => {
use crate::logger::{LogLevel::*, *}; use crate::logger::{LogLevel::*, *};
@ -57,7 +58,7 @@ macro_rules! warn {
log!(Warn, $a); log!(Warn, $a);
}; };
} }
#[macro_export]
macro_rules! info { macro_rules! info {
($a:expr) => { ($a:expr) => {
use crate::logger::{LogLevel::*, *}; use crate::logger::{LogLevel::*, *};