mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-03 09:09:42 +02:00
signalr cleanup
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
using System;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Messaging;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation.Commands
|
||||
{
|
||||
public class ClearLogCommand : ICommand
|
||||
public class ClearLogCommand : Command
|
||||
{
|
||||
public String CommandId { get; private set; }
|
||||
|
||||
public ClearLogCommand()
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
CommandId = HashUtil.GenerateCommandId();
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,16 +1,18 @@
|
||||
using System;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Messaging;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation.Commands
|
||||
{
|
||||
public class DeleteLogFilesCommand : ICommand
|
||||
public class DeleteLogFilesCommand : Command
|
||||
{
|
||||
public String CommandId { get; private set; }
|
||||
|
||||
public DeleteLogFilesCommand()
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
CommandId = HashUtil.GenerateCommandId();
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,16 +1,11 @@
|
||||
using System;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Messaging;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation.Commands
|
||||
{
|
||||
public class TrimLogCommand : ICommand
|
||||
public class TrimLogCommand : Command
|
||||
{
|
||||
public String CommandId { get; private set; }
|
||||
|
||||
public TrimLogCommand()
|
||||
{
|
||||
CommandId = HashUtil.GenerateCommandId();
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,8 +3,8 @@ using NLog.Config;
|
||||
using NLog;
|
||||
using NLog.Layouts;
|
||||
using NLog.Targets;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
@@ -5,8 +5,8 @@ using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Instrumentation.Commands;
|
||||
using NzbDrone.Core.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Messaging;
|
||||
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Instrumentation.Commands;
|
||||
using NzbDrone.Core.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
34
NzbDrone.Core/Instrumentation/LoggerExtensions.cs
Normal file
34
NzbDrone.Core/Instrumentation/LoggerExtensions.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using NLog;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
public static class LoggerExtensions
|
||||
{
|
||||
public static void ProgressInfo(this Logger logger, string message, params object[] args)
|
||||
{
|
||||
var formattedMessage = String.Format(message, args);
|
||||
LogProgressMessage(logger, LogLevel.Info, formattedMessage);
|
||||
}
|
||||
|
||||
public static void ProgressDebug(this Logger logger, string message, params object[] args)
|
||||
{
|
||||
var formattedMessage = String.Format(message, args);
|
||||
LogProgressMessage(logger, LogLevel.Debug, formattedMessage);
|
||||
}
|
||||
|
||||
public static void ProgressTrace(this Logger logger, string message, params object[] args)
|
||||
{
|
||||
var formattedMessage = String.Format(message, args);
|
||||
LogProgressMessage(logger, LogLevel.Trace, formattedMessage);
|
||||
}
|
||||
|
||||
private static void LogProgressMessage(Logger logger, LogLevel level, string message)
|
||||
{
|
||||
var logEvent = new LogEventInfo(level, logger.Name, message);
|
||||
logEvent.Properties.Add("Status", "");
|
||||
|
||||
logger.Log(logEvent);
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,10 +3,10 @@ using System.Linq;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Targets;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Configuration.Events;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
Reference in New Issue
Block a user