Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
chore: add trace logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazmi35 authored Mar 20, 2024
1 parent 6efef5d commit 02d870f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/kanao-cache/src/Listeners/Caches/DispatchListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export class DispatchListener extends Listener {
}

public async run(payload: { shardId: number; data: { data: GatewayDispatchPayload; }; }): Promise<void> {
this.logger.trace({ shardId: payload.shardId, data: payload.data }, "Dispatch event received");

switch (payload.data.data.t) {
case GatewayDispatchEvents.GuildCreate:
case GatewayDispatchEvents.ChannelCreate:
Expand Down
2 changes: 2 additions & 0 deletions services/kanao-gateway/src/Listeners/DispatchListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class DispatchListener extends Listener {
public async run(payload: { shardId: number; data: { data: GatewayDispatchPayload; }; }): Promise<void> {
const routing = new RoutedQueue(GatewayExchangeRoutes.RECEIVE, clientId);

this.logger.trace({ shardId: payload.shardId, data: payload.data, routing }, "Dispatch event received");

await this.store.amqp.publish(RabbitMQ.GATEWAY_EXCHANGE, routing.key, Buffer.from(JSON.stringify({ data: payload.data, shardId: payload.shardId })), { replyTo: clientId });
}
}

0 comments on commit 02d870f

Please sign in to comment.