2010-10-24 00:46:58 -07:00
|
|
|
using System.IO;
|
|
|
|
using System.Text;
|
|
|
|
using NLog;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Instrumentation
|
|
|
|
{
|
|
|
|
public class NlogWriter : TextWriter
|
|
|
|
{
|
2011-03-28 17:12:48 -07:00
|
|
|
private static readonly Logger Logger = LogManager.GetLogger("NzbDrone.SubSonic");
|
2010-10-24 00:46:58 -07:00
|
|
|
|
2011-04-09 19:44:01 -07:00
|
|
|
public override Encoding Encoding
|
|
|
|
{
|
|
|
|
get { return Encoding.Default; }
|
|
|
|
}
|
|
|
|
|
2010-10-24 00:46:58 -07:00
|
|
|
|
|
|
|
public override void Write(char[] buffer, int index, int count)
|
|
|
|
{
|
|
|
|
Write(new string(buffer, index, count));
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(string value)
|
|
|
|
{
|
|
|
|
DbAction(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void DbAction(string value)
|
|
|
|
{
|
2011-06-03 18:56:53 -07:00
|
|
|
Logger.Trace(value.Replace("`t0`.", ""));
|
2010-10-24 00:46:58 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|