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-09-11 06:33:47 +00:00
|
|
|
|
private readonly Logger _logger = NzbDroneLogger.GetLogger();
|
2013-08-28 22:08:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override Encoding Encoding
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Encoding.Default;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-11 06:33:47 +00:00
|
|
|
|
public override void Write(char[] buffer, int index, int count)
|
2013-08-28 22:08:01 +00:00
|
|
|
|
{
|
2013-09-11 06:33:47 +00:00
|
|
|
|
Write(buffer);
|
2013-08-28 22:08:01 +00:00
|
|
|
|
}
|
|
|
|
|
public override void Write(char[] buffer)
|
|
|
|
|
{
|
2013-09-11 06:33:47 +00:00
|
|
|
|
Write(new string(buffer));
|
2013-08-28 22:08:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Write(string value)
|
|
|
|
|
{
|
2013-09-11 06:33:47 +00:00
|
|
|
|
_logger.Trace(value);
|
2013-08-28 22:08:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-11 06:33:47 +00:00
|
|
|
|
public override void Write(char value)
|
2013-08-28 22:08:01 +00:00
|
|
|
|
{
|
2013-09-11 06:33:47 +00:00
|
|
|
|
_logger.Trace(value);
|
2013-08-28 22:08:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|