2013-08-28 22:08:01 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using NLog;
|
2013-08-31 01:42:30 +00:00
|
|
|
|
using NzbDrone.Common.Instrumentation;
|
2013-08-28 22:08:01 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Host.Owin
|
|
|
|
|
{
|
|
|
|
|
public class NlogTextWriter : TextWriter
|
|
|
|
|
{
|
2013-08-31 01:42:30 +00:00
|
|
|
|
private readonly Logger logger = NzbDroneLogger.GetLogger();
|
2013-08-28 22:08:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override Encoding Encoding
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Encoding.Default;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Write(char value)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Write(char[] buffer)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(buffer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Write(string value)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Write(char[] buffer, int index, int count)
|
|
|
|
|
{
|
|
|
|
|
logger.Trace(buffer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|