Making the macro not require a use statement.

This commit is contained in:
Jason Travis Smith 2016-01-28 13:54:21 -05:00
parent c15daad3b1
commit d1e6e8f4fe
2 changed files with 20 additions and 7 deletions

View File

@ -2,9 +2,6 @@
extern crate scribe; extern crate scribe;
use scribe::*;
pub fn main() pub fn main()
{ {

View File

@ -45,33 +45,49 @@ macro_rules! error
{ {
($($arg: tt)*) => ($($arg: tt)*) =>
{ {
{
use scribe::LogLevel;
log!(LogLevel::ERROR, $($arg)*); log!(LogLevel::ERROR, $($arg)*);
} }
} }
}
#[macro_export] #[macro_export]
macro_rules! warn macro_rules! warn
{ {
($($arg: tt)*) => ($($arg: tt)*) =>
{ {
{
use scribe::LogLevel;
log!(LogLevel::WARN, $($arg)*); log!(LogLevel::WARN, $($arg)*);
} }
} }
}
#[macro_export] #[macro_export]
macro_rules! info macro_rules! info
{ {
($($arg: tt)*) => ($($arg: tt)*) =>
{ {
{
use scribe::LogLevel;
log!(LogLevel::INFO, $($arg)*); log!(LogLevel::INFO, $($arg)*);
} }
} }
}
#[macro_export] #[macro_export]
macro_rules! debug macro_rules! debug
{ {
($($arg: tt)*) => ($($arg: tt)*) =>
{ {
{
use scribe::LogLevel;
log!(LogLevel::DEBUG, $($arg)*); log!(LogLevel::DEBUG, $($arg)*);
} }
} }
}