|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
/// <summary>
/// Summary description for Log
/// </summary>
public static class Log
{
public static bool Enabled { get; set; }
public static void Write(string format, params object[] args)
{
if (!Enabled || !HttpContext.Current.IsDebuggingEnabled) return;
var fileName = HttpContext.Current.Server.MapPath("~/App_Data/Rabbit/Log");
using (StreamWriter sw = File.AppendText(fileName))
{
sw.WriteLine(DateTime.Now.ToString() + " " + string.Format(format, args));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.