Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected override int VisitSequenceValue(ThemedValueFormatterState state, Seque
}

delim = ", ";
Visit(state.Nest(), sequence.Elements[index]);
count += Visit(state.Nest(), sequence.Elements[index]);
}

using (ApplyStyle(state.Output, ConsoleThemeStyle.TertiaryText, ref count))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ class ExceptionTokenRenderer : OutputTemplateTokenRenderer

readonly ConsoleTheme _theme;

public ExceptionTokenRenderer(ConsoleTheme theme, PropertyToken pt)
public ExceptionTokenRenderer(ConsoleTheme theme)
{
_theme = theme;
}
_theme = theme;
}

public override void Render(LogEvent logEvent, TextWriter output)
{
// Padding is never applied by this renderer.

if (logEvent.Exception is null)
return;

var lines = new StringReader(logEvent.Exception.ToString());
string? nextLine;
while ((nextLine = lines.ReadLine()) != null)
{
var style = nextLine.StartsWith(StackFrameLinePrefix) ? ConsoleThemeStyle.SecondaryText : ConsoleThemeStyle.Text;
var _ = 0;
using (_theme.Apply(output, style, ref _))
output.Write(nextLine);
output.WriteLine();
}
// Padding is never applied by this renderer.

if (logEvent.Exception is null)
return;

var lines = new StringReader(logEvent.Exception.ToString());
string? nextLine;
while ((nextLine = lines.ReadLine()) != null)
{
var style = nextLine.StartsWith(StackFrameLinePrefix) ? ConsoleThemeStyle.SecondaryText : ConsoleThemeStyle.Text;
var _ = 0;
using (_theme.Apply(output, style, ref _))
output.Write(nextLine);
output.WriteLine();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public OutputTemplateRenderer(ConsoleTheme theme, string outputTemplate, IFormat
}
else if (pt.PropertyName == OutputProperties.ExceptionPropertyName)
{
renderers.Add(new ExceptionTokenRenderer(theme, pt));
renderers.Add(new ExceptionTokenRenderer(theme));
}
else if (pt.PropertyName == OutputProperties.MessagePropertyName)
{
Expand Down