mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Use Microsoft.Extensions.Logging abstraction
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Text;
|
||||
@@ -173,7 +173,7 @@ namespace SocketHttpListener.Net
|
||||
|
||||
private void OnTimeout(object unused)
|
||||
{
|
||||
//_logger.Info("HttpConnection timer fired");
|
||||
//_logger.LogInformation("HttpConnection timer fired");
|
||||
CloseSocket();
|
||||
Unbind();
|
||||
}
|
||||
@@ -556,4 +556,4 @@ namespace SocketHttpListener.Net
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Text;
|
||||
@@ -173,7 +173,7 @@ namespace SocketHttpListener.Net
|
||||
{
|
||||
HttpEndPointListener epl = (HttpEndPointListener)acceptEventArg.UserToken;
|
||||
|
||||
epl._logger.ErrorException("Error in socket.AcceptAsync", ex);
|
||||
epl._logger.LogError("Error in socket.AcceptAsync", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace SocketHttpListener.Net
|
||||
|
||||
if (socketError == SocketError.ConnectionReset)
|
||||
{
|
||||
epl._logger.Error("SocketError.ConnectionReset reported. Attempting to re-accept.");
|
||||
epl._logger.LogError("SocketError.ConnectionReset reported. Attempting to re-accept.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -223,13 +223,13 @@ namespace SocketHttpListener.Net
|
||||
{
|
||||
var remoteEndPointString = accepted.RemoteEndPoint == null ? string.Empty : accepted.RemoteEndPoint.ToString();
|
||||
var localEndPointString = accepted.LocalEndPoint == null ? string.Empty : accepted.LocalEndPoint.ToString();
|
||||
//_logger.Info("HttpEndPointListener Accepting connection from {0} to {1} secure connection requested: {2}", remoteEndPointString, localEndPointString, _secure);
|
||||
//_logger.LogInformation("HttpEndPointListener Accepting connection from {0} to {1} secure connection requested: {2}", remoteEndPointString, localEndPointString, _secure);
|
||||
|
||||
HttpConnection conn = new HttpConnection(epl._logger, accepted, epl, epl._secure, epl._cert, epl._cryptoProvider, epl._streamHelper, epl._textEncoding, epl._fileSystem, epl._environment);
|
||||
|
||||
await conn.Init().ConfigureAwait(false);
|
||||
|
||||
//_logger.Debug("Adding unregistered connection to {0}. Id: {1}", accepted.RemoteEndPoint, connectionId);
|
||||
//_logger.LogDebug("Adding unregistered connection to {0}. Id: {1}", accepted.RemoteEndPoint, connectionId);
|
||||
lock (epl._unregisteredConnections)
|
||||
{
|
||||
epl._unregisteredConnections[conn] = conn;
|
||||
@@ -238,7 +238,7 @@ namespace SocketHttpListener.Net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
epl._logger.ErrorException("Error in ProcessAccept", ex);
|
||||
epl._logger.LogError("Error in ProcessAccept", ex);
|
||||
|
||||
TryClose(accepted);
|
||||
epl.Accept();
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using SocketHttpListener.Primitives;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Security.Cryptography.X509Certificates;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Text;
|
||||
@@ -59,7 +59,7 @@ namespace SocketHttpListener.Net
|
||||
}
|
||||
|
||||
public HttpListener(X509Certificate certificate, ICryptoProvider cryptoProvider, ISocketFactory socketFactory, INetworkManager networkManager, ITextEncoding textEncoding, IStreamHelper streamHelper, IFileSystem fileSystem, IEnvironmentInfo environmentInfo)
|
||||
:this(new NullLogger(), certificate, cryptoProvider, socketFactory, networkManager, textEncoding, streamHelper, fileSystem, environmentInfo)
|
||||
:this(null, certificate, cryptoProvider, socketFactory, networkManager, textEncoding, streamHelper, fileSystem, environmentInfo)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Security.Principal;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.IO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Text;
|
||||
using SocketHttpListener.Net.WebSockets;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace SocketHttpListener.Net
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.System;
|
||||
|
||||
namespace SocketHttpListener.Net
|
||||
|
||||
Reference in New Issue
Block a user