Title: Message

You can do it using ContextBoundObject and some context settings, it’s not very well known (at least that I’ve seen), but it’s possible.

If you want something like this, check out an Aspect Oriented Programning (AOP) for dotNet, They should contain it already.

Be aware, currently, AFAIK, there is some performance hit using this method, as always, measure and see if it’s acceptable.

 


From: Mario Gutierrez [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 23, 2004 7:12 PM
To: 'Log4NET User'
Subject: RE: Anyone consdiering attributes?

 

The idea is to have attributes like LogEntry and LogExit that automaticaly log the entry and exit of any method call. As I read more about attributes, I'm not sure it's possible to do this unless I build an entire framework to read these attributes and act on them. Since there are dependency injection frameworks, Spring and pico come to mind, I think I'll use one of those instead and create interceptors.

 

-----Original Message-----
From: Ayende Rahien [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 6:07 PM
To: 'Log4NET User'; [EMAIL PROTECTED]
Subject: RE: Anyone consdiering attributes?

What do you want to do with this?

 

 


From: Mario Gutierrez [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 23, 2004 1:44 AM
To: 'Log4NET User'
Subject: Anyone consdiering attributes?

 

If not, maybe I'll contribute if I can find a free weekend.

 

[LogEntry(ifLevel=Debug)]

public void Foo() {

    // ...

}

 

.: mario gutierrez

 

Reply via email to