From d1e6e8f4fe5460ae8eed61941434ae295b3e29fe Mon Sep 17 00:00:00 2001 From: Jason Travis Smith Date: Thu, 28 Jan 2016 13:54:21 -0500 Subject: [PATCH] Making the macro not require a use statement. --- examples/logging.rs | 3 --- src/macros.rs | 24 ++++++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/examples/logging.rs b/examples/logging.rs index 0f56bd9..54d2cf5 100644 --- a/examples/logging.rs +++ b/examples/logging.rs @@ -2,9 +2,6 @@ extern crate scribe; -use scribe::*; - - pub fn main() { diff --git a/src/macros.rs b/src/macros.rs index 1c87656..17ee702 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -45,7 +45,11 @@ macro_rules! error { ($($arg: tt)*) => { - log!(LogLevel::ERROR, $($arg)*); + { + use scribe::LogLevel; + + log!(LogLevel::ERROR, $($arg)*); + } } } @@ -54,7 +58,11 @@ macro_rules! warn { ($($arg: tt)*) => { - log!(LogLevel::WARN, $($arg)*); + { + use scribe::LogLevel; + + log!(LogLevel::WARN, $($arg)*); + } } } @@ -63,7 +71,11 @@ macro_rules! info { ($($arg: tt)*) => { - log!(LogLevel::INFO, $($arg)*); + { + use scribe::LogLevel; + + log!(LogLevel::INFO, $($arg)*); + } } } @@ -72,6 +84,10 @@ macro_rules! debug { ($($arg: tt)*) => { - log!(LogLevel::DEBUG, $($arg)*); + { + use scribe::LogLevel; + + log!(LogLevel::DEBUG, $($arg)*); + } } }