Skip to content

Commit a62daa9

Browse files
committed
feat: add logging for event processing in ProcessAggregatedEvents and ProcessWebhookEvent
1 parent d69de1d commit a62daa9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Jobs/ProcessAggregatedEvents.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Queue\InteractsWithQueue;
1010
use Illuminate\Queue\SerializesModels;
1111
use Illuminate\Support\Facades\Cache;
12+
use Illuminate\Support\Facades\Log;
1213

1314
class ProcessAggregatedEvents implements ShouldQueue
1415
{
@@ -42,16 +43,18 @@ public function handle(): void
4243

4344
return;
4445
}
45-
46+
Log::info('ProcessAggregatedEvents: Event message: '.json_encode($eventMessages));
4647
$message = $this->aggregateMessages($eventMessages);
4748
Cache::forget($commentAggregationCacheKey);
4849
$author = Cache::pull($commentAggregationCacheKey.'_author', '');
4950

51+
Log::info('ProcessAggregatedEvents: Author: '.json_encode($author));
5052
$message .= '\n\n'.view(
5153
'github-project::md.shared.author',
5254
['name' => $author['name'], 'html_url' => $author['html_url']]
5355
)->render();
5456

57+
Log::info('ProcessAggregatedEvents: Message: '.$message);
5558
$githubService = new GithubService;
5659
$githubService->commentOnNode($this->nodeId, $message);
5760
}

src/Jobs/ProcessWebhookEvent.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Queue\InteractsWithQueue;
99
use Illuminate\Queue\SerializesModels;
1010
use Illuminate\Support\Facades\Cache;
11+
use Illuminate\Support\Facades\Log;
1112

1213
class ProcessWebhookEvent implements ShouldQueue
1314
{
@@ -55,7 +56,9 @@ public function handle(): void
5556
now()->addSeconds($commentAggregationTime)
5657
);
5758
}
58-
59+
Log::info('Event message count: '.count($eventMessages));
60+
Log::info('Event message: '.json_encode($eventMessages));
61+
Log::info('Event author: '.json_encode(Cache::get($commentAggregationCacheKey.'_author')));
5962
if (count($eventMessages) === 1) {
6063
ProcessAggregatedEvents::dispatch($nodeId)->delay(now()->addSeconds($commentAggregationTime));
6164
}

0 commit comments

Comments
 (0)