Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r committed Jul 20, 2023
1 parent 24c5fd6 commit 4fd69e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ namespace Serilog
/// </summary>
public static class ConsoleAuditLoggerConfigurationExtensions
{
static readonly object DefaultSyncRoot = new object();
const string DefaultConsoleOutputTemplate = "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}";

/// <summary>
/// Writes log events to <see cref="System.Console"/>.
/// </summary>
Expand All @@ -55,11 +52,11 @@ public static class ConsoleAuditLoggerConfigurationExtensions
public static LoggerConfiguration Console(
this LoggerAuditSinkConfiguration sinkConfiguration,
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
string outputTemplate = DefaultConsoleOutputTemplate,
string outputTemplate = ConsoleLoggerConfigurationExtensions.DefaultConsoleOutputTemplate,
IFormatProvider? formatProvider = null,
LoggingLevelSwitch? levelSwitch = null,
LogEventLevel? standardErrorFromLevel = null,
ConsoleTheme? theme = null,
ConsoleTheme? theme = null,
bool applyThemeToRedirectedOutput = false,
object? syncRoot = null)
{
Expand All @@ -70,7 +67,7 @@ public static LoggerConfiguration Console(
ConsoleTheme.None :
theme ?? SystemConsoleThemes.Literate;

syncRoot ??= DefaultSyncRoot;
syncRoot ??= ConsoleLoggerConfigurationExtensions.DefaultSyncRoot;

var formatter = new OutputTemplateRenderer(appliedTheme, outputTemplate, formatProvider);
return sinkConfiguration.Sink(new ConsoleSink(appliedTheme, formatter, standardErrorFromLevel, syncRoot), restrictedToMinimumLevel, levelSwitch);
Expand Down Expand Up @@ -104,7 +101,7 @@ public static LoggerConfiguration Console(
if (sinkConfiguration is null) throw new ArgumentNullException(nameof(sinkConfiguration));
if (formatter is null) throw new ArgumentNullException(nameof(formatter));

syncRoot ??= DefaultSyncRoot;
syncRoot ??= ConsoleLoggerConfigurationExtensions.DefaultSyncRoot;

return sinkConfiguration.Sink(new ConsoleSink(ConsoleTheme.None, formatter, standardErrorFromLevel, syncRoot), restrictedToMinimumLevel, levelSwitch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace Serilog
/// </summary>
public static class ConsoleLoggerConfigurationExtensions
{
static readonly object DefaultSyncRoot = new object();
const string DefaultConsoleOutputTemplate = "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}";
internal static readonly object DefaultSyncRoot = new object();
internal const string DefaultConsoleOutputTemplate = "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}";

/// <summary>
/// Writes log events to <see cref="System.Console"/>.
Expand Down

0 comments on commit 4fd69e1

Please sign in to comment.