using System;
using System.Collections.Generic;
using System.Text;

using log4net;
using ChuPiao.Common.Enums;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace ChuPiao.Common.Utils
{
    public class Logger
    {
        public static readonly log4net.ILog Log = log4net.LogManager.GetLogger("default");
        public static readonly log4net.ILog xwLog = log4net.LogManager.GetLogger("xw");
        public static readonly log4net.ILog qxLog = log4net.LogManager.GetLogger("qx");
        public static readonly log4net.ILog pwLog = log4net.LogManager.GetLogger("pw");
        public static readonly log4net.ILog psLog = log4net.LogManager.GetLogger("ps");
        public static readonly log4net.ILog ltLog = log4net.LogManager.GetLogger("lt");
        public static readonly log4net.ILog jqLog = log4net.LogManager.GetLogger("jq");
        public static readonly log4net.ILog bqLog = log4net.LogManager.GetLogger("bq");
        public static readonly log4net.ILog sfLog = log4net.LogManager.GetLogger("sf");
        public static readonly log4net.ILog dlLog = log4net.LogManager.GetLogger("dl");
        public static readonly log4net.ILog jzLog = log4net.LogManager.GetLogger("jz");
        public static readonly log4net.ILog jlLog = log4net.LogManager.GetLogger("jl");
        public static readonly log4net.ILog jmLog = log4net.LogManager.GetLogger("jm");
        public static readonly log4net.ILog bdLog = log4net.LogManager.GetLogger("bd");
        public static readonly log4net.ILog dsLog = log4net.LogManager.GetLogger("ds");
        public static readonly log4net.ILog xsLog = log4net.LogManager.GetLogger("xs");
        public static readonly log4net.ILog jdLog = log4net.LogManager.GetLogger("jd");

        public static log4net.ILog GetLoggerByLottype(int lottype)
        {
            log4net.ILog log = null;
            Lottype _lottype = (Lottype)lottype;
            switch (_lottype)
            { 
                case Lottype.Xw:
                    log = xwLog;
                    break;
                case Lottype.Qx:
                    log = qxLog;
                    break;
                case Lottype.Pw:
                    log = pwLog;
                    break;
                case Lottype.Ps:
                    log = psLog;
                    break;
                case Lottype.Lt:
                    log = ltLog;
                    break;
                case Lottype.Jq:
                    log = jqLog;
                    break;
                case Lottype.Bq:
                    log = bqLog;
                    break;
                case Lottype.Sf:
                    log = sfLog;
                    break;
                case Lottype.Dl:
                case Lottype.Hd:
                    log = dlLog;
                    break;
                case Lottype.Jz:
                    log = jzLog;
                    break;
                case Lottype.Jl:
                    log = jlLog;
                    break;
                case Lottype.Jm:
                    log = jmLog;
                    break;
                case Lottype.Bd:
                    log = bdLog;
                    break;
                case Lottype.Ds:
                    log = dsLog;
                    break;
                case Lottype.Xs:
                    log = xsLog;
                    break;
                case Lottype.Jd:
                    log = jdLog;
                    break;
                default:
                    log = Log;
                    break;
            }
            return log;
        }
    }
}
