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