/// <summary> /// Log something /// </summary> /// <param name="logEntry"><see cref="LogEntry"/> instance to log</param> public void Log(LogEntry logEntry) { if (logEntry.Exception != null && logEntry.Args.Length > 0) { ExceptionFormatMethods[logEntry.Level](logEntry); } else if (logEntry.Exception != null) { ExceptionMethods[logEntry.Level](logEntry); } else if (logEntry.Args.Length > 0) { FormatMethods[logEntry.Level](logEntry); } else { MessageMethods[logEntry.Level](logEntry); } }
public InterpolationStringReplacer() { patternMatchingList = new List <PatternMachingStructure> { new PatternMachingStructure { FilterPredicate = x => FormatMethodsWithObjects.Contains(x), SelectorArgumentsFunc = x => x.Arguments.Skip(1), ReturnFunc = InterpolationToStringConcat }, new PatternMachingStructure { FilterPredicate = x => FormatMethodWithArrayParameter.Contains(x), SelectorArgumentsFunc = x => ((NewArrayExpression)x.Arguments.Last()).Expressions, ReturnFunc = InterpolationToStringConcat }, new PatternMachingStructure() { FilterPredicate = x => FormatMethods.All(xx => xx != x), SelectorArgumentsFunc = x => x.Arguments, ReturnFunc = (node, _) => base.VisitMethodCall(node) } }; }
private IMessage FormatedMessage(IMessage message) { return(FormatMethods.GetFormatMethod(comboBox_FormattingOptions.SelectedText).Invoke(message)); }