Introducing this.Log - Rob Reynolds - The Fervent Coder - Devlicio.us - Just the Tasty ... - 0 views
-
Johann Strydom on 18 Dec 12"One of my favorite creations over the past year has been this.Log(). It works everywhere including static methods and in razor views. Everything about how to create it and set it up is in this gist. How it looks public class SomeClass { public void SomeMethod() { this.Log().Info(() => "Here is a log message with params which can be in Razor Views as well: '{0}'".FormatWith(typeof(SomeClass).Name)); this.Log().Debug("I don't have to be delayed execution or have parameters either"); } public static void StaticMethod() { "SomeClass".Log().Error("This is crazy, right?!"); } } "