20
20
using System . Text . RegularExpressions ;
21
21
using Serilog . Events ;
22
22
using Serilog . Expressions . Runtime ;
23
- using Serilog . Formatting . Display ;
24
23
using Serilog . Parsing ;
25
24
using Serilog . Templates . Compilation ;
26
25
@@ -32,7 +31,7 @@ static class Intrinsics
32
31
{
33
32
static readonly LogEventPropertyValue NegativeOne = new ScalarValue ( - 1 ) ;
34
33
static readonly LogEventPropertyValue Tombstone = new ScalarValue ( "😬 (if you see this you have found a bug.)" ) ;
35
-
34
+
36
35
public static List < LogEventPropertyValue ? > CollectSequenceElements ( LogEventPropertyValue ? [ ] elements )
37
36
{
38
37
return elements . ToList ( ) ;
@@ -53,18 +52,18 @@ static class Intrinsics
53
52
if ( content is SequenceValue sequence )
54
53
foreach ( var element in sequence . Elements )
55
54
elements . Add ( element ) ;
56
-
55
+
57
56
return elements ;
58
57
}
59
58
60
59
public static LogEventPropertyValue ConstructSequenceValue ( List < LogEventPropertyValue ? > elements )
61
60
{
62
61
if ( elements . Any ( el => el == null ) )
63
62
return new SequenceValue ( elements . Where ( el => el != null ) ) ;
64
-
63
+
65
64
return new SequenceValue ( elements ) ;
66
65
}
67
-
66
+
68
67
public static List < LogEventProperty > CollectStructureProperties ( string [ ] names , LogEventPropertyValue ? [ ] values )
69
68
{
70
69
var properties = new List < LogEventProperty > ( ) ;
@@ -85,7 +84,7 @@ public static LogEventPropertyValue ConstructStructureValue(List<LogEventPropert
85
84
86
85
return new StructureValue ( properties ) ;
87
86
}
88
-
87
+
89
88
public static List < LogEventProperty > ExtendStructureValueWithSpread (
90
89
List < LogEventProperty > properties ,
91
90
LogEventPropertyValue ? content )
@@ -99,7 +98,7 @@ public static List<LogEventProperty> ExtendStructureValueWithSpread(
99
98
100
99
return properties ;
101
100
}
102
-
101
+
103
102
public static List < LogEventProperty > ExtendStructureValueWithProperty (
104
103
List < LogEventProperty > properties ,
105
104
string name ,
@@ -129,7 +128,7 @@ public static bool CoerceToScalarBoolean(LogEventPropertyValue value)
129
128
return b ;
130
129
return false ;
131
130
}
132
-
131
+
133
132
public static LogEventPropertyValue ? IndexOfMatch ( LogEventPropertyValue value , Regex regex )
134
133
{
135
134
if ( value is ScalarValue scalar &&
@@ -193,9 +192,9 @@ public static string RenderMessage(CompiledMessageToken formatter, EvaluationCon
193
192
if ( token is PropertyToken { Format : { } } pt )
194
193
{
195
194
elements ??= new List < LogEventPropertyValue > ( ) ;
196
-
195
+
197
196
var space = new StringWriter ( ) ;
198
-
197
+
199
198
pt . Render ( logEvent . Properties , space , formatProvider ) ;
200
199
elements . Add ( new ScalarValue ( space . ToString ( ) ) ) ;
201
200
}
0 commit comments