You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
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);
|
|
}
|
|
}
|
|
} |