From 988d9458a9742f9197ba1ec1ad9eea7fd5547e96 Mon Sep 17 00:00:00 2001 From: Lanta Date: Mon, 13 Nov 2023 10:31:00 +0100 Subject: [PATCH] discord logging --- discord/report_new_matches.ps1 | 5 ++++- discord/report_to_discord.ps1 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index 77a1641..3f9294a 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -1,3 +1,5 @@ +Start-Transcript -Path '/var/log/dtch/report_new_matches.log' -Append + if ($PSScriptRoot.length -eq 0) { $scriptroot = Get-Location } @@ -167,4 +169,5 @@ $newJson = $player_matches | ConvertTo-Json -Depth 100 # Display the updated JSON $newJson | out-file "$scriptroot/../data/player_matches.json" -remove-lock \ No newline at end of file +remove-lock +Stop-Transcript \ No newline at end of file diff --git a/discord/report_to_discord.ps1 b/discord/report_to_discord.ps1 index 4081a98..5369ffd 100644 --- a/discord/report_to_discord.ps1 +++ b/discord/report_to_discord.ps1 @@ -1,3 +1,5 @@ +Start-Transcript -Path '/var/log/report_new_matches.log' -Append + if ($PSScriptRoot.length -eq 0) { $scriptroot = Get-Location } @@ -96,4 +98,5 @@ $payload = [PSCustomObject]@{ } Invoke-RestMethod -Uri $webhookurl -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'Application/Json' -remove-lock \ No newline at end of file +remove-lock +Stop-Transcript \ No newline at end of file