Skip to content

Commit

Permalink
Add logs for AdaptiveCard
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUsama-afk-equinor authored and UsamaEquinorAFK committed Dec 15, 2023
1 parent 5261e61 commit 901e7a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/api/EventHandlers/InspectionFindingEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)

string messageString = GenerateReportFromFindingsReportsList(findingsList);

string adaptiveCardJson = GenerateAdaptiveCard(messageString);
string adaptiveCardJson = GenerateAdaptiveCard(messageString, logger);

string url = GetWebhookURL(configuration, "TeamsInspectionFindingsWebhook");

Expand Down Expand Up @@ -116,8 +116,9 @@ public static string GenerateReportFromFindingsReportsList(List<Finding> finding
return reportBuilder.ToString();
}

public static string GenerateAdaptiveCard(string messageContent)
public static string GenerateAdaptiveCard(string messageContent, ILogger<InspectionFindingEventHandler> logger)
{
logger.LogInformation("Message content for Adaptive card: {message}", messageContent);
string adaptiveCardJson = $@"{{
""type"": ""message"",
""attachments"": [
Expand Down

0 comments on commit 901e7a8

Please sign in to comment.