Skip to content

Commit f4318af

Browse files
committed
fixed typos
1 parent 13f648f commit f4318af

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

src/log4net/Layout/PatternLayout.cs

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ namespace log4net.Layout;
237237
/// <term>identity</term>
238238
/// <description>
239239
/// <para>
240-
/// Used to output the user name for the currently active user
240+
/// Used to output the username for the currently active user
241241
/// (Principal.Identity.Name).
242242
/// </para>
243243
/// <para>
@@ -315,7 +315,7 @@ namespace log4net.Layout;
315315
/// <para>
316316
/// If a precision specifier is given, then only the corresponding
317317
/// number of right most components of the logger name will be
318-
/// printed. By default the logger name is printed in full.
318+
/// printed. By default, the logger name is printed in full.
319319
/// </para>
320320
/// <para>
321321
/// For example, for the logger name "a.b.c" the pattern
@@ -410,12 +410,12 @@ namespace log4net.Layout;
410410
/// <term>property</term>
411411
/// <description>
412412
/// <para>
413-
/// Used to output the an event specific property. The key to
413+
/// Used to output an event specific property. The key to
414414
/// lookup must be specified within braces and directly following the
415415
/// pattern specifier, e.g. <b>%property{user}</b> would include the value
416416
/// from the property that is keyed by the string 'user'. Each property value
417417
/// that is to be included in the log must be specified separately.
418-
/// Properties are added to events by loggers or appenders. By default
418+
/// Properties are added to events by loggers or appenders. By default,
419419
/// the <c>log4net:HostName</c> property is set to the name of machine on
420420
/// which the event was originally logged.
421421
/// </para>
@@ -527,7 +527,7 @@ namespace log4net.Layout;
527527
/// <para>
528528
/// If a precision specifier is given, then only the corresponding
529529
/// number of right most components of the class name will be
530-
/// printed. By default the class name is output in fully qualified form.
530+
/// printed. By default, the class name is output in fully qualified form.
531531
/// </para>
532532
/// <para>
533533
/// For example, for the class name "log4net.Layout.PatternLayout", the
@@ -618,7 +618,7 @@ namespace log4net.Layout;
618618
/// longer more descriptive pattern names.
619619
/// </para>
620620
/// <para>
621-
/// By default the relevant information is output as is. However,
621+
/// By default, the relevant information is output as is. However,
622622
/// with the aid of format modifiers it is possible to change the
623623
/// minimum field width, the maximum field width and justification.
624624
/// </para>
@@ -755,7 +755,7 @@ namespace log4net.Layout;
755755
/// </para>
756756
/// <para>
757757
/// This means that in a Release build the caller information may be incomplete or may
758-
/// not exist at all! Therefore caller location information cannot be relied upon in a Release build.
758+
/// not exist at all! Therefore, caller location information cannot be relied upon in a Release build.
759759
/// </para>
760760
/// </note>
761761
/// <para>
@@ -939,7 +939,7 @@ public PatternLayout() : this(DefaultConversionPattern)
939939
/// </remarks>
940940
public PatternLayout(string? pattern)
941941
{
942-
// By default we do not process the exception
942+
// By default, we do not process the exception
943943
IgnoresException = true;
944944

945945
ConversionPattern = pattern ?? DefaultConversionPattern;
@@ -1016,15 +1016,11 @@ public override void ActivateOptions()
10161016
PatternConverter? curConverter = _head;
10171017
while (curConverter is not null)
10181018
{
1019-
if (curConverter is PatternLayoutConverter layoutConverter)
1019+
if (curConverter is PatternLayoutConverter { IgnoresException: false })
10201020
{
1021-
if (!layoutConverter.IgnoresException)
1022-
{
1023-
// Found converter that handles the exception
1024-
IgnoresException = false;
1025-
1026-
break;
1027-
}
1021+
// Found converter that handles the exception
1022+
IgnoresException = false;
1023+
break;
10281024
}
10291025
curConverter = curConverter.Next;
10301026
}
@@ -1089,12 +1085,9 @@ public void AddConverter(ConverterInfo converterInfo)
10891085
/// <see cref="PatternConverter"/> type.
10901086
/// </para>
10911087
/// </remarks>
1092-
public void AddConverter(string name, Type type)
1088+
public void AddConverter(string name, Type type) => AddConverter(new()
10931089
{
1094-
AddConverter(new()
1095-
{
1096-
Name = name.EnsureNotNull(),
1097-
Type = type.EnsureNotNull()
1098-
});
1099-
}
1090+
Name = name.EnsureNotNull(),
1091+
Type = type.EnsureNotNull()
1092+
});
11001093
}

0 commit comments

Comments
 (0)