1
- // Copyright (c) .NET Foundation. All rights reserved.
1
+ // Copyright (c) .NET Foundation. All rights reserved.
2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
4
using System ;
@@ -11,25 +11,24 @@ internal static class MvcRazorLoggerExtensions
11
11
{
12
12
private static readonly double TimestampToTicks = TimeSpan . TicksPerSecond / ( double ) Stopwatch . Frequency ;
13
13
14
- private static readonly Action < ILogger , string , Exception > _generatedCodeToAssemblyCompilationStart ;
15
- private static readonly Action < ILogger , string , double , Exception > _generatedCodeToAssemblyCompilationEnd ;
14
+ private static readonly Action < ILogger , string , Exception ? > _generatedCodeToAssemblyCompilationStart ;
15
+ private static readonly Action < ILogger , string , double , Exception ? > _generatedCodeToAssemblyCompilationEnd ;
16
16
17
- private static readonly Action < ILogger , string , Exception > _viewCompilerStartCodeGeneration ;
18
- private static readonly Action < ILogger , string , double , Exception > _viewCompilerEndCodeGeneration ;
19
- private static readonly Action < ILogger , string , Exception > _viewCompilerLocatedCompiledView ;
20
- private static readonly Action < ILogger , Exception > _viewCompilerNoCompiledViewsFound ;
21
- private static readonly Action < ILogger , string , Exception > _viewCompilerLocatedCompiledViewForPath ;
22
- private static readonly Action < ILogger , string , Exception > _viewCompilerRecompilingCompiledView ;
23
- private static readonly Action < ILogger , string , Exception > _viewCompilerCouldNotFindFileToCompileForPath ;
24
- private static readonly Action < ILogger , string , Exception > _viewCompilerFoundFileToCompileForPath ;
25
- private static readonly Action < ILogger , string , Exception > _viewCompilerInvalidatingCompiledFile ;
17
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerStartCodeGeneration ;
18
+ private static readonly Action < ILogger , string , double , Exception ? > _viewCompilerEndCodeGeneration ;
19
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerLocatedCompiledView ;
20
+ private static readonly Action < ILogger , Exception ? > _viewCompilerNoCompiledViewsFound ;
21
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerLocatedCompiledViewForPath ;
22
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerCouldNotFindFileToCompileForPath ;
23
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerFoundFileToCompileForPath ;
24
+ private static readonly Action < ILogger , string , Exception ? > _viewCompilerInvalidatingCompiledFile ;
26
25
27
- private static readonly Action < ILogger , string , string , Exception > _viewLookupCacheMiss ;
28
- private static readonly Action < ILogger , string , string , Exception > _viewLookupCacheHit ;
29
- private static readonly Action < ILogger , string , Exception > _precompiledViewFound ;
26
+ private static readonly Action < ILogger , string , string ? , Exception ? > _viewLookupCacheMiss ;
27
+ private static readonly Action < ILogger , string , string ? , Exception ? > _viewLookupCacheHit ;
28
+ private static readonly Action < ILogger , string , Exception ? > _precompiledViewFound ;
30
29
31
- private static readonly Action < ILogger , string , Exception > _tagHelperComponentInitialized ;
32
- private static readonly Action < ILogger , string , Exception > _tagHelperComponentProcessed ;
30
+ private static readonly Action < ILogger , string , Exception ? > _tagHelperComponentInitialized ;
31
+ private static readonly Action < ILogger , string , Exception ? > _tagHelperComponentProcessed ;
33
32
34
33
35
34
static MvcRazorLoggerExtensions ( )
@@ -59,11 +58,6 @@ static MvcRazorLoggerExtensions()
59
58
new EventId ( 5 , "ViewCompilerLocatedCompiledViewForPath" ) ,
60
59
"Located compiled view for view at path '{Path}'." ) ;
61
60
62
- _viewCompilerRecompilingCompiledView = LoggerMessage . Define < string > (
63
- LogLevel . Trace ,
64
- new EventId ( 6 , "ViewCompilerRecompilingCompiledView" ) ,
65
- "Invalidating compiled view for view at path '{Path}'." ) ;
66
-
67
61
_viewCompilerCouldNotFindFileToCompileForPath = LoggerMessage . Define < string > (
68
62
LogLevel . Trace ,
69
63
new EventId ( 7 , "ViewCompilerCouldNotFindFileAtPath" ) ,
@@ -79,12 +73,12 @@ static MvcRazorLoggerExtensions()
79
73
new EventId ( 9 , "ViewCompilerInvalidingCompiledFile" ) ,
80
74
"Invalidating compiled view at path '{Path}' with a file since the checksum did not match." ) ;
81
75
82
- _viewLookupCacheMiss = LoggerMessage . Define < string , string > (
76
+ _viewLookupCacheMiss = LoggerMessage . Define < string , string ? > (
83
77
LogLevel . Debug ,
84
78
new EventId ( 1 , "ViewLookupCacheMiss" ) ,
85
79
"View lookup cache miss for view '{ViewName}' in controller '{ControllerName}'." ) ;
86
80
87
- _viewLookupCacheHit = LoggerMessage . Define < string , string > (
81
+ _viewLookupCacheHit = LoggerMessage . Define < string , string ? > (
88
82
LogLevel . Debug ,
89
83
new EventId ( 2 , "ViewLookupCacheHit" ) ,
90
84
"View lookup cache hit for view '{ViewName}' in controller '{ControllerName}'." ) ;
@@ -161,12 +155,12 @@ public static void ViewCompilerInvalidingCompiledFile(this ILogger logger, strin
161
155
_viewCompilerInvalidatingCompiledFile ( logger , path , null ) ;
162
156
}
163
157
164
- public static void ViewLookupCacheMiss ( this ILogger logger , string viewName , string controllerName )
158
+ public static void ViewLookupCacheMiss ( this ILogger logger , string viewName , string ? controllerName )
165
159
{
166
160
_viewLookupCacheMiss ( logger , viewName , controllerName , null ) ;
167
161
}
168
162
169
- public static void ViewLookupCacheHit ( this ILogger logger , string viewName , string controllerName )
163
+ public static void ViewLookupCacheHit ( this ILogger logger , string viewName , string ? controllerName )
170
164
{
171
165
_viewLookupCacheHit ( logger , viewName , controllerName , null ) ;
172
166
}
0 commit comments