mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Removed System.Windows.Forms dependancy from Common. Almost done removing NLog dependancy.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Alchemy.Classes;
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using ServiceStack.Common;
|
||||
using ServiceStack.Common.Web;
|
||||
@@ -22,17 +21,18 @@ namespace MediaBrowser.Common.Net
|
||||
/// </summary>
|
||||
public class BaseRestService : Service, IRestfulService
|
||||
{
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
protected ILogger Logger = LogManager.GetLogger("RestService");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the kernel.
|
||||
/// </summary>
|
||||
/// <value>The kernel.</value>
|
||||
public IKernel Kernel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the logger.
|
||||
/// </summary>
|
||||
/// <value>The logger.</value>
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is range request.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -23,12 +21,6 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
public abstract class BaseHandler<TKernelType> : IHttpServerHandler
|
||||
where TKernelType : IKernel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the logger.
|
||||
/// </summary>
|
||||
/// <value>The logger.</value>
|
||||
protected ILogger Logger { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the specified kernel.
|
||||
/// </summary>
|
||||
@@ -36,7 +28,6 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
public void Initialize(IKernel kernel)
|
||||
{
|
||||
Kernel = (TKernelType)kernel;
|
||||
Logger = SharedLogger.Logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -303,7 +294,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
|
||||
response.ContentType = "text/plain";
|
||||
|
||||
Logger.ErrorException("Error processing request", ex);
|
||||
//Logger.ErrorException("Error processing request", ex);
|
||||
|
||||
if (!string.IsNullOrEmpty(ex.Message))
|
||||
{
|
||||
@@ -321,7 +312,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Logger.ErrorException("Error dumping stack trace", ex1);
|
||||
//Logger.ErrorException("Error dumping stack trace", ex1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +440,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
|
||||
if (Kernel.Configuration.EnableHttpLevelLogging)
|
||||
{
|
||||
Logger.LogMultiline(msg, LogSeverity.Debug, log);
|
||||
//Logger.LogMultiline(msg, LogSeverity.Debug, log);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,7 +595,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error disposing compressed stream", ex);
|
||||
//Logger.ErrorException("Error disposing compressed stream", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +606,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error disposing response", ex);
|
||||
//Logger.ErrorException("Error disposing response", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,14 +741,6 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
internal static class SharedLogger
|
||||
{
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
internal static ILogger Logger = LogManager.GetLogger("Http Handler");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class ResponseInfo
|
||||
/// </summary>
|
||||
|
||||
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using ServiceStack.Api.Swagger;
|
||||
using ServiceStack.Common.Web;
|
||||
using ServiceStack.Logging;
|
||||
using ServiceStack.Logging.NLogger;
|
||||
using ServiceStack.ServiceHost;
|
||||
using ServiceStack.ServiceInterface.Cors;
|
||||
@@ -144,6 +143,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
|
||||
container.Register(Kernel);
|
||||
container.Register(_logger);
|
||||
|
||||
foreach (var service in Kernel.RestServices)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
Serialization.JsonSerializer.Configure();
|
||||
|
||||
LogManager.LogFactory = new NLogFactory();
|
||||
ServiceStack.Logging.LogManager.LogFactory = new NLogFactory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
Reference in New Issue
Block a user