Skip to content

Commit

Permalink
Make TimeProvider nullable in config
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Jul 22, 2024
1 parent b035cde commit 552ad83
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public static ResolvedLoggerConfiguration Resolve(string loggerName, ZeroLogConf
{
LogMessagePoolExhaustionStrategy = effectiveLogMessagePoolExhaustionStrategy,
#if NET8_0_OR_GREATER
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
TimeProvider = configuration.TimeProvider ?? TimeProvider.System
#endif
};
Expand Down
4 changes: 2 additions & 2 deletions src/ZeroLog.Impl.Full/Configuration/ZeroLogConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ public bool UseBackgroundThread
/// The time provider to use for message timestamps.
/// </summary>
/// <remarks>
/// Default: <see cref="System.TimeProvider.System"/>.
/// Default: <c>null</c>, which falls back to <see cref="System.TimeProvider.System"/>.
/// </remarks>
public TimeProvider TimeProvider { get; init; } = TimeProvider.System;
public TimeProvider? TimeProvider { get; init; }
#endif

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace ZeroLog.Configuration
public int LogMessageBufferSize { get; init; }
public int LogMessagePoolSize { get; init; }
public int LogMessageStringCapacity { get; init; }
public System.TimeProvider TimeProvider { get; init; }
public System.TimeProvider? TimeProvider { get; init; }
public bool UseBackgroundThread { get; init; }
public void ApplyChanges() { }
public void SetLogLevel(string? loggerName, ZeroLog.LogLevel? logLevel) { }
Expand Down

0 comments on commit 552ad83

Please sign in to comment.