Exemplo n.º 1
0
        private IAppender[] ReadAppenders(int n)
        {
            IAppender[] appenders = new IAppender[n];

            for (int i = 0; i < n; i++)
            {
                string[]    appenderParts = reader.ReadLine().Split();
                string      appenderType  = appenderParts[0];
                string      layoutType    = appenderParts[1];
                ReportLevel reportLevel   = appenderParts.Length == 3 ? Enum.Parse <ReportLevel>(appenderParts[2], true) : ReportLevel.Info;

                ILayout   layout   = layoutFactory.CreateFactory(layoutType);
                IAppender appender = appenderFactory.CreateAppender(appenderType, layout, reportLevel);

                appenders[i] = appender;
            }
            return(appenders);
        }