Monday, August 21, 2006

logging on method level: MethodBase.GetCurrentMethod()

if you like to add some information where you located within your code use something like this:

using System.Reflection;
.
.
.
Logger.YourMethodForMessages(

"Validation failed in: " +
((object)MethodBase.GetCurrentMethod()).ToString() + "; it has some invalid data;";

);

cheers

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge