File tree Expand file tree Collapse file tree
src/C3D/Extensions/Logging/Xunit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Microsoft . Extensions . Logging ;
2+ using System . Globalization ;
23
34namespace C3D . Extensions . Xunit . Logging ;
45
@@ -26,6 +27,8 @@ public XunitLoggerOptions(TimeProvider timeProvider) : this(timeProvider.GetUtcN
2627 private int ? prefixLength ;
2728 private string ? timeStampFormat ;
2829
30+ public System . Globalization . CultureInfo ? Culture { get ; set ; }
31+
2932 public XunitLoggerTimeStamp TimeStamp { get ; set ; } = XunitLoggerTimeStamp . None ;
3033 public string TimeStampFormat {
3134 get => timeStampFormat ?? TimeStamp switch
@@ -43,8 +46,8 @@ public string TimeStampFormat {
4346
4447 private string ? DefaultTimeStamp ( ) => TimeStamp switch
4548 {
46- XunitLoggerTimeStamp . DateTime => GetUtcNow ( ) . ToString ( TimeStampFormat ) ,
47- XunitLoggerTimeStamp . Offset => ( GetUtcNow ( ) - LogStart ) . ToString ( TimeStampFormat ) ,
49+ XunitLoggerTimeStamp . DateTime => GetUtcNow ( ) . ToString ( TimeStampFormat , Culture ?? CultureInfo . CurrentCulture ) ,
50+ XunitLoggerTimeStamp . Offset => ( GetUtcNow ( ) - LogStart ) . ToString ( TimeStampFormat , Culture ?? CultureInfo . CurrentCulture ) ,
4851 _ => null
4952 } ;
5053 #endregion
You can’t perform that action at this time.
0 commit comments