using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StubCore.Plugins.Logging
{
    public class CollectorsLogger : DataLogger
    {

        public void ItemWasNotFound<T>(T item, int id)
        {
            var _type = typeof(T).ToString();
            var message = String.Format("[FrontCollector - GetItem: {0}] The {0} with ID: {1} was not found", _type, id);

            _logger.Info(message);
        }

        public void ProfileListNotExists(string type)
        {
            var message = String.Format("[{0}Collector] The list of items is empty or not exists", type);
            _logger.Info(message);
        }

        public void UpdateObjectNotFound(int id, string type)
        {
            var message = String.Format("[{0}Collector] Cannot update item with ID: {1} not found.", id, type);
            _logger.Info(message);
        }

        public void DeleteObjectNotFound(int id, string type)
        {
            var message = String.Format("[{0}Collector] Cannot delete item with ID: {1} not found.", id, type);
            _logger.Info(message);
        }

        public void NoValuesFoundForNode(int id)
        {
            var message = String.Format("[NodeValuesCollector] No values was found for node with ID: {0}", id);
            _logger.Info(message);
        }

        public void NoValuesFoundForNodes(List<int> nodes)
        {
            var ids = String.Empty;

            foreach(int id in nodes)
            {
                ids += id + ";"; 
            }

            var message = String.Format("[NodeValuesCollector] No values was found for nodes with IDs: {0}", ids);
            _logger.Info(message);
        }

        public void ItemsListNotExists(string type)
        {
            var message = String.Format("[{0}Collector] The list of {1} is empty or not exists", type, type.ToLower());
            _logger.Info(message);
        }

        public void NoFileValuesWasFound(int id)
        {
            var message = String.Format("[NodeValuesCollector] No values was found for file with ID: {0}", id);
            _logger.Info(message);
        }

        public void NoItemsFoundForProfile(int id, string type)
        {
            var message = String.Format("[{0}Collector] No {1} was found for profile with ID: {2}", type, type.ToLower(), id);
            _logger.Info(message);
        }

        public void IndexListZero()
        {
            _logger.Info("[ProfilesCollector] Cannot find last index, list is empty. Return zero");
        }

    }
}
