11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License. See License.txt in the project root for license information.
33
4- using System ;
54using System . Collections . Generic ;
65using DotnetIsolatedTests . Common ;
76using Microsoft . Extensions . Logging ;
@@ -16,15 +15,15 @@ namespace DotnetIsolatedTests
1615 /// </summary>
1716 public static class MultiFunctionTrigger
1817 {
19- private static readonly Action < ILogger , string , Exception > _loggerMessage = LoggerMessage . Define < string > ( LogLevel . Information , eventId : new EventId ( 0 , "INFO" ) , formatString : "{Message}" ) ;
2018
2119 [ Function ( nameof ( MultiFunctionTrigger1 ) ) ]
2220 public static void MultiFunctionTrigger1 (
2321 [ SqlTrigger ( "[dbo].[Products]" , "SqlConnectionString" ) ]
2422 IReadOnlyList < SqlChange < Product > > products ,
2523 FunctionContext context )
2624 {
27- _loggerMessage ( context . GetLogger ( "ProductsTriggerWithValidation" ) , "Trigger1 Changes: " + Utils . JsonSerializeObject ( products ) , null ) ;
25+ ILogger logger = context . GetLogger ( "MultiFunctionTrigger1" ) ;
26+ logger . LogInformation ( "Trigger1 Changes: " + Utils . JsonSerializeObject ( products ) , null ) ;
2827 }
2928
3029 [ Function ( nameof ( MultiFunctionTrigger2 ) ) ]
@@ -33,7 +32,8 @@ public static void MultiFunctionTrigger2(
3332 IReadOnlyList < SqlChange < Product > > products ,
3433 FunctionContext context )
3534 {
36- _loggerMessage ( context . GetLogger ( "ProductsTriggerWithValidation" ) , "Trigger2 Changes: " + Utils . JsonSerializeObject ( products ) , null ) ;
35+ ILogger logger = context . GetLogger ( "MultiFunctionTrigger1" ) ;
36+ logger . LogInformation ( "Trigger2 Changes: " + Utils . JsonSerializeObject ( products ) , null ) ;
3737 }
3838 }
3939}
0 commit comments