using MEU.API.MiddleWare;
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MEU.API.Logs
{
    public class LoggerFactory
    {
        //private static logger = NLog.Config.con Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
        private static Logger logger = LogManager.GetCurrentClassLogger();
        public static void ErrorLog(String messenge, String title)
        {
            logger.Error(messenge, title);
            var currentContext = AppHttpContext.Current;
            if (currentContext == null)
            {
                return;
            }
            if (currentContext.Items.ContainsKey("LOG_DATA"))
            {
                currentContext.Items["LOG_DATA"] += messenge;
            }
            else
            {
                currentContext.Items.Add("LOG_DATA", messenge);
            }
        }
        public static void DebugLog(String messenge, String title = "")
        {
            
        }

        public static void TraceLog(String messenge, String title = "")
        {
           
        }

        public static void InfoLog(String messenge, String title = "")
        {
            logger.Error(messenge, title);
        }

        public static void WarnLog(String messenge, String title = "")
        {
            
        }

        public static void FatalLog(String messenge, String title = "")
        {
           
        }
    }
}
