fix: Consistent debug log spacing (#10349)

* fix: consistent debug log spacing

* refactor: simplify formatting

* refactor: more readable ternary

Co-Authored-By: Synbulat Biishev <contact@syjalo.dev>

* fix: modify parameters and types

---------

Co-authored-by: Synbulat Biishev <contact@syjalo.dev>
This commit is contained in:
Jiralite
2024-06-13 17:07:37 +01:00
committed by Vlad Frangu
parent 5761f2cbfd
commit c6710e56cc
4 changed files with 30 additions and 43 deletions

View File

@@ -834,15 +834,6 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
}
private debug(messages: [string, ...string[]]) {
const message = `${messages[0]}${
messages.length > 1
? `\n${messages
.slice(1)
.map((m) => ` ${m}`)
.join('\n')}`
: ''
}`;
this.emit(WebSocketShardEvents.Debug, { message });
this.emit(WebSocketShardEvents.Debug, { message: messages.join('\n\t') });
}
}