Skip to content

Commit

Permalink
TargetWithContext - Fix InternalLogger output about Object reflection…
Browse files Browse the repository at this point in the history
… needed (#5273)
  • Loading branch information
snakefoot authored Jul 1, 2023
1 parent a9dd3fb commit c51e14c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/NLog/Config/AssemblyExtensionTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ internal static class AssemblyExtensionTypes
public static void RegisterTypes(ConfigurationItemFactory factory)
{
#pragma warning disable CS0618 // Type or member is obsolete
factory.RegisterTypeProperties<NLog.Targets.TargetWithContext.TargetWithContextLayout>(() => null);
factory.RegisterTypeProperties<NLog.Layouts.CsvLayout.CsvHeaderLayout>(() => null);
factory.RegisterTypeProperties<NLog.Conditions.ConditionAndExpression>(() => null);
factory.RegisterTypeProperties<NLog.Conditions.ConditionExceptionExpression>(() => null);
factory.RegisterTypeProperties<NLog.Conditions.ConditionLayoutExpression>(() => null);
Expand Down
2 changes: 2 additions & 0 deletions src/NLog/Config/AssemblyExtensionTypes.tt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ namespace NLog.Config
public static void RegisterTypes(ConfigurationItemFactory factory)
{
#pragma warning disable CS0618 // Type or member is obsolete
factory.RegisterTypeProperties<NLog.Targets.TargetWithContext.TargetWithContextLayout>(() => null);
factory.RegisterTypeProperties<NLog.Layouts.CsvLayout.CsvHeaderLayout>(() => null);
<#
var types = typeof(NLog.LogFactory).Assembly.GetTypes().OrderBy(t => t.ToString());

Expand Down
2 changes: 1 addition & 1 deletion src/NLog/Layouts/CSV/CsvLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private bool ColumnValueRequiresQuotes(CsvQuotingMode quoting, StringBuilder sb,
/// </summary>
[ThreadAgnostic]
[AppDomainFixedOutput]
private sealed class CsvHeaderLayout : Layout
internal sealed class CsvHeaderLayout : Layout
{
private readonly CsvLayout _parent;
private string _headerOutput;
Expand Down
2 changes: 1 addition & 1 deletion src/NLog/Targets/TargetWithContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ protected virtual bool SerializeItemValue(LogEventInfo logEvent, string name, ob
}

[ThreadAgnostic]
private sealed class TargetWithContextLayout : Layout, IIncludeContext, IUsesStackTrace
internal sealed class TargetWithContextLayout : Layout, IIncludeContext, IUsesStackTrace
{
public Layout TargetLayout { get => _targetLayout; set => _targetLayout = ReferenceEquals(this, value) ? _targetLayout : value; }
private Layout _targetLayout;
Expand Down

0 comments on commit c51e14c

Please sign in to comment.