Skip to content

Commit 419cc7d

Browse files
committed
Refactor: event description formatting in logging
1 parent fb69cdc commit 419cc7d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ export default defineConfig([
261261
"prefer-numeric-literals": "error",
262262
"prefer-rest-params": "error",
263263
"prefer-spread": "error",
264-
"prefer-template": "error",
265264
"require-yield": "error",
266265
"rest-spread-spacing": [
267266
"error",

src/Event.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import type { IEvent } from './interfaces/IEvent.ts';
44
* Get text description of an event for logging purposes
55
*/
66
export function describe(event: IEvent): string {
7-
return `'${event.type}' of ${event.aggregateId} (v${event.aggregateVersion})`;
7+
return `'${event.type}'`
8+
+ (event.id ? ` (id: ${event.id})` : '')
9+
+ (event.aggregateId ? ` of ${event.aggregateId} (v${event.aggregateVersion})` : '');
810
}
911

1012
/**

0 commit comments

Comments
 (0)