Skip to content

Commit 229cdc6

Browse files
committed
Improve logging of automatically executed events
- log when a user times out and an action is executed on their behalf - log when an admin action is executed
1 parent 9ba83cf commit 229cdc6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/models/DraftsStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export class DraftsStore {
255255
if (expectedActions.length > 0) {
256256
for (let expectedAction of expectedActions) {
257257
const message = new PlayerEvent(expectedAction.player, actionTypeFromAction(expectedAction.action), Civilisation.RANDOM);
258+
logger.info('Countdown ran out, executing action on player\'s behalf: %s', JSON.stringify(message), {draftId});
258259
actListener(message, () => {
259260
});
260261
}

src/util/Listeners.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const Listeners = {
7070
if (actionTypeFromAction(expectedAction.action) === ActionType.REVEAL) {
7171
const draftEvent = new AdminEvent(expectedAction.player, expectedAction.action);
7272
setTimeout(() => {
73+
logger.info('Executing admin event: %s', JSON.stringify(draftEvent), {draftId});
7374
draftViews.reveal(expectedAction.action);
7475
socket.nsp
7576
.in(roomHost)

0 commit comments

Comments
 (0)