From 3874adb8cf315358151c87e0ad2c3392e22a5b33 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko Date: Wed, 27 Oct 2021 02:57:57 +0300 Subject: [PATCH] Extend possible new line character when parsing stacktrace --- src/ReportPortal.Extensions.SourceBack/SourceBackFormatter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ReportPortal.Extensions.SourceBack/SourceBackFormatter.cs b/src/ReportPortal.Extensions.SourceBack/SourceBackFormatter.cs index 96eb64f..43fcf25 100644 --- a/src/ReportPortal.Extensions.SourceBack/SourceBackFormatter.cs +++ b/src/ReportPortal.Extensions.SourceBack/SourceBackFormatter.cs @@ -40,8 +40,10 @@ public bool FormatLog(CreateLogItemRequest logRequest) { _traceLogger.Info($"Parsing exception stacktrace in log message with {logRequest.Level} level..."); - foreach (var line in logRequest.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) + foreach (var line in logRequest.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None)) { + _traceLogger.Verbose("Parsing line as stacktrace frame:" + Environment.NewLine + line); + var lineWithoutMarkdown = line.Replace("`", @"\`").Replace("__", @"\__"); var match = Regex.Match(line, @"\s+\w+\s.*\s\w+\s(.*):\w+\s(\d+)");