@@ -12,12 +12,22 @@ public static LogEvent InformationEvent(string messageTemplate = "Hello, world!"
12
12
return LogEvent ( LogEventLevel . Information , messageTemplate , propertyValues ) ;
13
13
}
14
14
15
+ public static LogEvent InformationEvent ( DateTimeOffset timestamp , string messageTemplate = "Hello, world!" , params object ? [ ] propertyValues )
16
+ {
17
+ return LogEvent ( timestamp , LogEventLevel . Information , messageTemplate , propertyValues ) ;
18
+ }
19
+
15
20
public static LogEvent WarningEvent ( string messageTemplate = "Hello, world!" , params object ? [ ] propertyValues )
16
21
{
17
22
return LogEvent ( LogEventLevel . Warning , messageTemplate , propertyValues ) ;
18
23
}
19
24
20
25
public static LogEvent LogEvent ( LogEventLevel level , string messageTemplate = "Hello, world!" , params object ? [ ] propertyValues )
26
+ {
27
+ return LogEvent ( DateTimeOffset . Now , level , messageTemplate , propertyValues ) ;
28
+ }
29
+
30
+ public static LogEvent LogEvent ( DateTimeOffset timestamp , LogEventLevel level , string messageTemplate = "Hello, world!" , params object ? [ ] propertyValues )
21
31
{
22
32
var log = new LoggerConfiguration ( ) . CreateLogger ( ) ;
23
33
#pragma warning disable Serilog004 // Constant MessageTemplate verifier
@@ -26,7 +36,7 @@ public static LogEvent LogEvent(LogEventLevel level, string messageTemplate = "H
26
36
{
27
37
throw new XunitException ( "Template could not be bound." ) ;
28
38
}
29
- return new ( DateTimeOffset . Now , level , null , template , properties ) ;
39
+ return new ( timestamp , level , null , template , properties ) ;
30
40
}
31
41
32
42
public static object AnonymousObject ( )
0 commit comments