public void AddAppender(string[] args) { string appenderType = args[0]; string layoutType = args[1]; ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = appenderFactory.CreateAppender(appenderType, layout); if (args.Length == 3) { appender.ReportLevel = (ReportLevel)Enum.Parse(typeof(ReportLevel), args[2], true); } appenders.Add(appender); }
public void AddAppender(string[] tokens) { ILayout layout = layoutFactory.CreateLayout(tokens[1]); IAppender appender = appenderFactory.CreateAppender(tokens[0], layout); appender.ReportLevel = ReportLevel.INFO; if (tokens.Length == 3) { appender.ReportLevel = Enum.Parse <ReportLevel>(tokens[2], true); } this.appenders.Add(appender); }
public void AddAppender(string[] args) { string appenderType = args[0]; string layoutType = args[1]; ReportLevel reportLevel = ReportLevel.INFO; if (args.Length == 3) { reportLevel = Enum.Parse <ReportLevel>(args[2]); } IAppender appender = this.appenderFactory.CreateAppender(appenderType, layoutFactory.CreateLayout(layoutType)); appender.ReportLevel = reportLevel; this.appenders.Add(appender); }
public void AddAppender(string[] args) { var appenderType = args[0]; var layoutType = args[1]; var reportLevel = ReportLevel.INFO; if (args.Length == 3) { reportLevel = Enum.Parse <ReportLevel>(args[2]); } var currentLayout = layoutFactory.CreateLayout(layoutType); var currentAppender = appenderFactory.CreateAppender(appenderType, currentLayout); currentAppender.ReportLevel = reportLevel; this.appenders.Add(currentAppender); }
public void AddAppender(string[] appenderConfig) // "<appender type> <layout type> <REPORT LEVEL>" { string appenderType = appenderConfig[0]; string layoutType = appenderConfig[1]; ILayout layout = _layoutFactory.CreateLayout(layoutType); IAppender appender = _appenderFactory.CreateAppender(appenderType, layout); if (appenderConfig.Length == 3) { appender.ReportLevel = (ReportLevel)Enum.Parse(typeof(ReportLevel), appenderConfig[3]); } //fix that else { appender.ReportLevel = ReportLevel.Info; } _appenders.Add(appender); }
public void AddAppender(string[] args) { string appenderType = args[0]; string layoutType = args[1]; ReportLevel reportLevel = ReportLevel.INFO; //Sets the report level to the lowest value in order to log all messages in case of no reportLevel given if (args.Length > 2) { reportLevel = Enum.Parse <ReportLevel>(args[2]); //Sets the report level to the given ReportLevel } var layout = layoutFactory.CreateLayout(layoutType); var appender = appenderFactory.CreateAppender(appenderType, layout); appender.ReportLevel = reportLevel; appenders.Add(appender); }
public void AddAppender(string[] args) { string appenderType = args[0]; string layoutType = args[1]; string reportLevel = null; if (args.Length == 3) { reportLevel = args[2]; } ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = appenderFactory.CreateAppender(appenderType, layout, reportLevel); appenders.Add(appender); }
public void AddAppender(string[] args) { string typeAppender = args[0]; string typeLayout = args[1]; ReportLevel reportLevel = ReportLevel.INFO; if (args.Length == 3) { reportLevel = Enum.Parse <ReportLevel>(args[2]); } ILayout layout = layoutFactory.CreateLayout(typeLayout); IAppender appender = this.appenderFactory.CreateAppender(typeAppender, layout); appender.ReportLevel = reportLevel; appenders.Add(appender); }
public void AddAppender(string[] args) { var appenderType = args[0]; var layoutType = args[1]; ReportLevel reportLevel = ReportLevel.INFO; if (args.Length == 3) { reportLevel = Enum.Parse <ReportLevel>(args[2]); } ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = appenderFactory.CreateAppender(appenderType, layout); appender.ReportLevel = reportLevel; appenders.Add(appender); }
private static IAppender[] ReadAppenders(int n) { IAppender[] appenders = new IAppender[n]; for (int i = 0; i < n; i++) { string[] appenderParts = Console.ReadLine().Split(); string appenderType = appenderParts[0]; string layoutType = appenderParts[1]; ReportLevel reportedLevel = appenderParts.Length == 3 ? Enum.Parse <ReportLevel>(appenderParts[2], true) : ReportLevel.Info; ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = apeenderFactory.CreateAppender(appenderType, layout , reportedLevel); appenders[i] = appender; } return(appenders); }
private IAppender[] ReadAllAppenders() { int n = int.Parse(Console.ReadLine()); IAppender[] appenders = new IAppender[n]; for (int i = 0; i < n; i++) { string[] appenderInfo = Console.ReadLine().Split(); string appenderType = appenderInfo[0]; string layoutType = appenderInfo[1]; string reportLevel = appenderInfo.Length == 3 ? reportLevel = appenderInfo[2] : reportLevel = ReportLevel.Info.ToString(); ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = appenderFactory.CreateAppender(appenderType, layout, reportLevel); appenders[i] = appender; } return(appenders); }
private IAppender[] ReadAppenders(int n) { IAppender[] appenders = new IAppender[n]; for (int i = 0; i < n; i++) { string[] data = this.reader.ReadLine().Split(); string appenderType = data[0]; string layoutType = data[1]; ReportLevel reportLevel = data.Length == 3 ? Enum.Parse <ReportLevel>(data[2], true) : ReportLevel.Info; ILayout layout = layoutFactory.CreateLayout(layoutType); IAppender appender = appenderFactory.CreateAppender(appenderType, layout, reportLevel); appenders[i] = appender; } return(appenders); }
private static List <IAppender> ReadAppender(int n) { List <IAppender> appenders = new List <IAppender>(); for (int i = 0; i < n; i++) { string[] data = Console.ReadLine().Split(); string apppender = data[0]; string layuotType = data[1]; ReportLevel reportLevel = ReportLevel.Info; ILayout layout = layoutFactory.CreateLayout(layuotType); if (data.Length == 3) { reportLevel = Enum.Parse <ReportLevel>(data[2], true); } IAppender apender = apenderFactory.CreateAppender(apppender, layout, reportLevel); appenders.Add(apender); } return(appenders); }