mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
|
using System;
|
|||
|
using MediaBrowser.Model.Logging;
|
|||
|
using ServiceStack.Logging;
|
|||
|
|
|||
|
namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Class ServerLogFactory
|
|||
|
/// </summary>
|
|||
|
public class ServerLogFactory : ILogFactory
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// The _log manager
|
|||
|
/// </summary>
|
|||
|
private readonly ILogManager _logManager;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Initializes a new instance of the <see cref="ServerLogFactory"/> class.
|
|||
|
/// </summary>
|
|||
|
/// <param name="logManager">The log manager.</param>
|
|||
|
public ServerLogFactory(ILogManager logManager)
|
|||
|
{
|
|||
|
_logManager = logManager;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Gets the logger.
|
|||
|
/// </summary>
|
|||
|
/// <param name="typeName">Name of the type.</param>
|
|||
|
/// <returns>ILog.</returns>
|
|||
|
public ILog GetLogger(string typeName)
|
|||
|
{
|
|||
|
return new ServerLogger(_logManager.GetLogger(typeName));
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Gets the logger.
|
|||
|
/// </summary>
|
|||
|
/// <param name="type">The type.</param>
|
|||
|
/// <returns>ILog.</returns>
|
|||
|
public ILog GetLogger(Type type)
|
|||
|
{
|
|||
|
return GetLogger(type.Name);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|