1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-24 00:42:38 +00:00
Radarr/NzbDrone.Test.Common/LoggingTest.cs
2011-11-07 23:01:52 -08:00

29 lines
985 B
C#

using NLog;
using NLog.Config;
using NzbDrone.Common;
namespace NzbDrone.Test.Common
{
public abstract class LoggingTest
{
protected static void InitLogging()
{
if (LogManager.Configuration == null || LogManager.Configuration is XmlLoggingConfiguration)
{
LogManager.Configuration = new LoggingConfiguration();
LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
LogConfiguration.RegisterUdpLogger();
RegisterExceptionVerification();
}
}
private static void RegisterExceptionVerification()
{
var exceptionVerification = new ExceptionVerification();
LogManager.Configuration.AddTarget("ExceptionVerification", exceptionVerification);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, exceptionVerification));
LogConfiguration.Reload();
}
}
}