Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Created April 17, 2010 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yetanotherchris/369741 to your computer and use it in GitHub Desktop.
Save yetanotherchris/369741 to your computer and use it in GitHub Desktop.
/// <summary>
/// Writes the args to the default logging output using the format provided.
/// </summary>
public static void WriteLine(LoggingLevel level,string format, params object[] args)
{
var name = new StackFrame(2,false).GetMethod().Name;
string prefix = string.Format("[{0} - {1}] ",level,name);
string message = string.Format(prefix + format, args);
WriteToFile(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment