Skip to content

Commit

Permalink
Extend possible new line character when parsing stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Oct 26, 2021
1 parent 97d2355 commit 3874adb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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+)");
Expand Down

0 comments on commit 3874adb

Please sign in to comment.