using Microsoft.Extensions.Logging;
using System.Collections.Generic;

// This file is part of the EonaCat project(s) which is released under the Apache License.
// See the LICENSE file or go to https://EonaCat.com/License for full license details.

namespace EonaCat.Logger.EonaCatCoreLogger
{
    public class ElasticSearchLoggerProvider : ILoggerProvider
    {
        private readonly ElasticSearchLoggerOptions _options;

        public ElasticSearchLoggerProvider(ElasticSearchLoggerOptions options = null)
        {
            if (options == null)
            {
                options = new ElasticSearchLoggerOptions();
            }
            _options = options;
        }

        public ILogger CreateLogger(string categoryName)
        {
            return new ElasticSearchLogger(categoryName, _options);
        }

        public void Dispose()
        {
            // No unmanaged resources, nothing to dispose here
        }
    }
}