-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed2687b
commit 4f934a9
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/C3D/Extensions/Logging/Xunit/Extensions/XunitLoggerOptionsExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Globalization; | ||
|
||
namespace C3D.Extensions.Xunit.Logging; | ||
|
||
public static class XunitLoggerOptionsExtensions { | ||
public static XunitLoggerOptions WithTimeStamp(this XunitLoggerOptions options, XunitLoggerTimeStamp timeStamp) | ||
{ | ||
options.TimeStamp = timeStamp; | ||
return options; | ||
} | ||
|
||
public static XunitLoggerOptions WithTimeStampFormat(this XunitLoggerOptions options, string timeStampFormat) | ||
{ | ||
options.TimeStampFormat = timeStampFormat; | ||
return options; | ||
} | ||
|
||
public static XunitLoggerOptions UseTimeProvider(this XunitLoggerOptions options, TimeProvider timeProvider) | ||
{ | ||
options.GetUtcNow = timeProvider.GetUtcNow; | ||
return options; | ||
} | ||
|
||
public static XunitLoggerOptions Restart(this XunitLoggerOptions options) | ||
{ | ||
options.LogStart = options.GetUtcNow(); | ||
return options; | ||
} | ||
|
||
public static XunitLoggerOptions UseCulture(this XunitLoggerOptions options, CultureInfo culture) | ||
{ | ||
options.Culture = culture; | ||
return options; | ||
} | ||
} |