using log4net.Repository;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace WsSubDemoNetCore
{
    public class Log4net
    {
        static log4net.ILog Logger = null;
        static Log4net()
        {
            ILoggerRepository repository = log4net.LogManager.CreateRepository("WsSubDemoNetCore");

            log4net.Config.XmlConfigurator.Configure(repository, new FileInfo("WsSubDemoNetCore.dll.config"));

            Logger = log4net.LogManager.GetLogger(repository.Name, "LocalLogger");
        }

        #region Info 信息
        public static void Info(object message)
        {
            Logger.Info(message);
        }

        public static void Info(object message, Exception exception)
        {
            Logger.Info(message, exception);
        }

        public static void InfoFormat(string format, object arg0)
        {
            Logger.InfoFormat(format, arg0);
        }

        public static void InfoFormat(string format, params object[] args)
        {
            Logger.InfoFormat(format, args);
        }

        public static void InfoFormat(IFormatProvider provider, string format, params object[] args)
        {
            Logger.InfoFormat(provider, format, args);
        }

        public static void InfoFormat(string format, object arg0, object arg1)
        {
            Logger.InfoFormat(format, arg0, arg1);
        }

        public static void InfoFormat(string format, object arg0, object arg1, object arg2)
        {
            Logger.InfoFormat(format, arg0, arg1, arg2);
        }
        #endregion

        #region Warn 警告,注意,通知
        /// <summary>
        /// 警告
        /// </summary>
        /// <param name="message"></param>
        public static void Warn(object message)
        {
            Logger.Warn(message);
        }

        public static void Warn(object message, Exception exception)
        {
            Logger.Warn(message, exception);
        }

        public static void WarnFormat(string format, object arg0)
        {
            Logger.WarnFormat(format, arg0);
        }

        public static void WarnFormat(string format, params object[] args)
        {
            Logger.WarnFormat(format, args);
        }

        public static void WarnFormat(IFormatProvider provider, string format, params object[] args)
        {
            Logger.WarnFormat(provider, format, args);
        }

        public static void WarnFormat(string format, object arg0, object arg1)
        {
            Logger.WarnFormat(format, arg0, arg1);
        }

        public static void WarnFormat(string format, object arg0, object arg1, object arg2)
        {
            Logger.WarnFormat(format, arg0, arg1, arg2);
        }
        #endregion

        #region Error 错误
        public static void Error(object message)
        {
            Logger.Error(message);
        }

        public static void Error(object message, Exception exception)
        {
            Logger.Error(message, exception);
        }

        public static void ErrorFormat(string format, object arg0)
        {
            Logger.ErrorFormat(format, arg0);
        }

        public static void ErrorFormat(string format, params object[] args)
        {
            Logger.ErrorFormat(format, args);
        }

        public static void ErrorFormat(IFormatProvider provider, string format, params object[] args)
        {
            Logger.ErrorFormat(provider, format, args);
        }

        public static void ErrorFormat(string format, object arg0, object arg1)
        {
            Logger.ErrorFormat(format, arg0, arg1);
        }

        public static void ErrorFormat(string format, object arg0, object arg1, object arg2)
        {
            Logger.ErrorFormat(format, arg0, arg1, arg2);
        }
        #endregion
    }
}