You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Host/Owin/NlogTextWriter.cs

40 lines
834 B

using System.IO;
using System.Text;
using NLog;
using NzbDrone.Common.Instrumentation;
namespace NzbDrone.Host.Owin
{
public class NlogTextWriter : TextWriter
{
11 years ago
private readonly Logger _logger = NzbDroneLogger.GetLogger();
public override Encoding Encoding
{
get
{
return Encoding.Default;
}
}
11 years ago
public override void Write(char[] buffer, int index, int count)
{
11 years ago
Write(buffer);
}
public override void Write(char[] buffer)
{
11 years ago
Write(new string(buffer));
}
public override void Write(string value)
{
11 years ago
_logger.Trace(value);
}
11 years ago
public override void Write(char value)
{
11 years ago
_logger.Trace(value);
}
}
}