mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
Fixed: Register Null Target for Sentry logs in Tests
This commit is contained in:
parent
9a25878104
commit
254561aeb1
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using NLog;
|
||||
|
@ -26,6 +26,8 @@ protected static void InitLogging()
|
||||
var logOutput = TestLogOutput.Console;
|
||||
Enum.TryParse<TestLogOutput>(Environment.GetEnvironmentVariable("RADARR_TESTS_LOG_OUTPUT"), out logOutput);
|
||||
|
||||
RegisterSentryLogger();
|
||||
|
||||
switch (logOutput)
|
||||
{
|
||||
case TestLogOutput.Console:
|
||||
@ -68,6 +70,13 @@ private static void RegisterFileLogger()
|
||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
|
||||
}
|
||||
|
||||
private static void RegisterSentryLogger()
|
||||
{
|
||||
// Register a null target for sentry logs, so they aren't caught by other loggers.
|
||||
var loggingRuleSentry = new LoggingRule("Sentry", LogLevel.Debug, new NullTarget()) { Final = true };
|
||||
LogManager.Configuration.LoggingRules.Insert(0, loggingRuleSentry);
|
||||
}
|
||||
|
||||
private static void RegisterExceptionVerification()
|
||||
{
|
||||
var exceptionVerification = new ExceptionVerification();
|
||||
|
Loading…
Reference in New Issue
Block a user