D H | 28 Jan 21:49

Re: Macros

On Fri, 28 Jan 2005 22:09:16 +0200, Ayende Rahien <Ayende@...> wrote:
> I want to create a macro that translate this: 
> 
>   
> 
> log debug "message" 
> 
>   
> 
> To: 
> 
>   
> 
> Logger.Debug("message") if Logger.IsDebugEnabled 
> 
>   
> 
> The problem that I've is that I'm unable to figure out how to make it. 
> 
> I've a LogMacro class, but I'm not sure how do I get the rest of the
> parameters, (the debug and the string) 
> 
> Furthermore, I'm not sure how I make the compiler recognize it. 

There is a debug macro available, or  I could write a "trace" macro.

Unfortunately "debug" won't work with booi because booi has no debug
option.  (booc does has a -d option)

You can capture debug messages by adding a debug listener:
(Continue reading)

Ayende Rahien | 28 Jan 21:58

RE: Macros

> There is a debug macro available, or  I could write a "trace" macro.
> 
> Unfortunately "debug" won't work with booi because booi has no debug
> option.  (booc does has a -d option)
> 
> You can capture debug messages by adding a debug listener:
> //import System.Diagnostics
> Debug.Listeners.Add(TextWriterTraceListener(Console.Out))
> 
> Replace console.out with whatever you want to use.  For example to
> have it print out to a file:
> Debug.Listeners.Add(TextWriterTraceListener(File.AppendText(filename))
> 
> I don't know if the parser could handle "log debug "message"".  Right
> now parameters for macros have to be comma separated.

The purpose here is to make it easier for me to use log4net.

I can use logdbg, logerr, loginfo etc instead.


Gmane