mirror of
https://github.com/Radarr/Radarr
synced 2025-02-27 00:23:19 +00:00
Merge pull request #50 from iaddis/nlog-debugger-output
Nlog debugger output
This commit is contained in:
commit
34a08f8abb
2 changed files with 19 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Config;
|
using NLog.Config;
|
||||||
|
@ -15,6 +16,11 @@ public static void Register(IStartupContext startupContext, bool updateApp, bool
|
||||||
|
|
||||||
LogManager.Configuration = new LoggingConfiguration();
|
LogManager.Configuration = new LoggingConfiguration();
|
||||||
|
|
||||||
|
if (Debugger.IsAttached)
|
||||||
|
{
|
||||||
|
RegisterDebugger();
|
||||||
|
}
|
||||||
|
|
||||||
RegisterExceptron();
|
RegisterExceptron();
|
||||||
|
|
||||||
if (updateApp)
|
if (updateApp)
|
||||||
|
@ -35,6 +41,18 @@ public static void Register(IStartupContext startupContext, bool updateApp, bool
|
||||||
LogManager.ReconfigExistingLoggers();
|
LogManager.ReconfigExistingLoggers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void RegisterDebugger()
|
||||||
|
{
|
||||||
|
DebuggerTarget target = new DebuggerTarget();
|
||||||
|
target.Name = "debuggerLogger";
|
||||||
|
target.Layout = "[${level}] [${threadid}] ${logger}: ${message} ${onexception:inner=${newline}${newline}${exception:format=ToString}${newline}}";
|
||||||
|
|
||||||
|
var loggingRule = new LoggingRule("*", LogLevel.Trace, target);
|
||||||
|
LogManager.Configuration.AddTarget("debugger", target);
|
||||||
|
LogManager.Configuration.LoggingRules.Add(loggingRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void RegisterConsole()
|
private static void RegisterConsole()
|
||||||
{
|
{
|
||||||
var level = LogLevel.Trace;
|
var level = LogLevel.Trace;
|
||||||
|
|
|
@ -153,7 +153,7 @@ public static ParsedEpisodeInfo ParseTitle(string title)
|
||||||
|
|
||||||
if (match.Count != 0)
|
if (match.Count != 0)
|
||||||
{
|
{
|
||||||
Debug.WriteLine(regex);
|
Logger.Trace(regex);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = ParseMatchCollection(match);
|
var result = ParseMatchCollection(match);
|
||||||
|
|
Loading…
Reference in a new issue