|
8 | 8 | using System.Reflection;
|
9 | 9 | using System.Threading.Tasks;
|
10 | 10 | using JetBrains.Annotations;
|
| 11 | +using Microsoft.Data.Entity.Extensions.Internal; |
| 12 | +using Microsoft.Data.Entity.Infrastructure; |
11 | 13 | using Microsoft.Data.Entity.Internal;
|
12 | 14 | using Microsoft.Data.Entity.Metadata;
|
13 | 15 | using Microsoft.Data.Entity.Metadata.Internal;
|
@@ -136,7 +138,10 @@ public virtual Func<QueryContext, IEnumerable<TResult>> CreateQueryExecutor<TRes
|
136 | 138 |
|
137 | 139 | using (QueryCompilationContext.Logger.BeginScopeImpl(this))
|
138 | 140 | {
|
139 |
| - QueryCompilationContext.Logger.LogDebug(queryModel, CoreStrings.LogCompilingQueryModel); |
| 141 | + QueryCompilationContext.Logger |
| 142 | + .LogVerbose( |
| 143 | + CoreLoggingEventId.CompilingQueryModel, |
| 144 | + () => CoreStrings.LogCompilingQueryModel(queryModel)); |
140 | 145 |
|
141 | 146 | _blockTaskExpressions = false;
|
142 | 147 |
|
@@ -166,7 +171,10 @@ public virtual Func<QueryContext, IAsyncEnumerable<TResult>> CreateAsyncQueryExe
|
166 | 171 |
|
167 | 172 | using (QueryCompilationContext.Logger.BeginScopeImpl(this))
|
168 | 173 | {
|
169 |
| - QueryCompilationContext.Logger.LogDebug(queryModel, CoreStrings.LogCompilingQueryModel); |
| 174 | + QueryCompilationContext.Logger |
| 175 | + .LogVerbose( |
| 176 | + CoreLoggingEventId.CompilingQueryModel, |
| 177 | + () => CoreStrings.LogCompilingQueryModel(queryModel)); |
170 | 178 |
|
171 | 179 | _blockTaskExpressions = false;
|
172 | 180 |
|
@@ -220,7 +228,10 @@ protected virtual void OptimizeQueryModel([NotNull] QueryModel queryModel)
|
220 | 228 |
|
221 | 229 | queryModel.TransformExpressions(_subQueryMemberPushDownExpressionVisitor.Visit);
|
222 | 230 |
|
223 |
| - QueryCompilationContext.Logger.LogDebug(queryModel, CoreStrings.LogOptimizedQueryModel); |
| 231 | + QueryCompilationContext.Logger |
| 232 | + .LogVerbose( |
| 233 | + CoreLoggingEventId.OptimizedQueryModel, |
| 234 | + () => CoreStrings.LogOptimizedQueryModel(queryModel)); |
224 | 235 | }
|
225 | 236 |
|
226 | 237 | protected virtual void SingleResultToSequence([NotNull] QueryModel queryModel)
|
@@ -333,9 +344,9 @@ var accessorLambda
|
333 | 344 | Expression.Parameter(queryModel.SelectClause.Selector.Type));
|
334 | 345 |
|
335 | 346 | QueryCompilationContext.Logger
|
336 |
| - .LogDebug( |
337 |
| - includeSpecification.NavigationPath.Join("."), |
338 |
| - CoreStrings.LogIncludingNavigation); |
| 347 | + .LogVerbose( |
| 348 | + CoreLoggingEventId.IncludingNavigation, |
| 349 | + () => CoreStrings.LogIncludingNavigation(includeSpecification.NavigationPath.Join("."))); |
339 | 350 |
|
340 | 351 | IncludeNavigations(
|
341 | 352 | includeSpecification,
|
@@ -404,10 +415,10 @@ var entityTrackingInfos
|
404 | 415 | if (entityTrackingInfos.Any())
|
405 | 416 | {
|
406 | 417 | QueryCompilationContext.Logger
|
407 |
| - .LogDebug( |
408 |
| - entityTrackingInfos, |
409 |
| - etis => CoreStrings.LogTrackingQuerySources( |
410 |
| - etis.Select(eti => eti.QuerySource.ItemName).Join())); |
| 418 | + .LogVerbose( |
| 419 | + CoreLoggingEventId.TrackingQuerySources, |
| 420 | + () => CoreStrings.LogTrackingQuerySources( |
| 421 | + entityTrackingInfos.Select(eti => eti.QuerySource.ItemName).Join())); |
411 | 422 |
|
412 | 423 | var resultItemType
|
413 | 424 | = _expression.Type.GetSequenceType();
|
@@ -482,7 +493,9 @@ protected virtual Func<QueryContext, TResults> CreateExecutorLambda<TResults>()
|
482 | 493 | .Lambda<Func<QueryContext, QueryResultScope, TResults>>(
|
483 | 494 | _expression, QueryContextParameter, QueryResultScopeParameter);
|
484 | 495 |
|
485 |
| - QueryCompilationContext.Logger.LogDebug(() => |
| 496 | + QueryCompilationContext.Logger.LogVerbose( |
| 497 | + CoreLoggingEventId.QueryPlan, |
| 498 | + () => |
486 | 499 | {
|
487 | 500 | var queryPlan = _expressionPrinter.Print(queryExecutorExpression);
|
488 | 501 |
|
|
0 commit comments