Skip to content

Instantly share code, notes, and snippets.

@SimonCropp
Created October 28, 2012 01:13
Show Gist options
  • Save SimonCropp/3967092 to your computer and use it in GitHub Desktop.
Save SimonCropp/3967092 to your computer and use it in GitHub Desktop.
Using
public class Log
{
public static Log With
{
get
{
throw new NotImplementedException();
}
}
public void Debug(string message)
{
throw new NotImplementedException();
}
}
Before weaving
public class ClassWithLogging
{
void MyMethod()
{
Log.With.Debug("TheMessage");
}
}
After weaving
public class ClassWithLogging
{
static Logger logger = LogManager.GetLogger("ClassWithLogging");
void MyMethod()
{
logger.Debug("Method:MyMethod, Line:3, Message: 'TheMessage'");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment