chore: improve mirror logging

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2023-01-29 01:44:07 -05:00
parent cd4c60a139
commit 8a6ed70e48

View File

@ -59,7 +59,7 @@ export class StaticMirroringWorker implements IRunnable {
.on('message', async function (raw: RawData) {
try {
const message = JSON.parse(raw.toString('utf8')) as OutgoingEventMessage
debug('received: %o', message)
debug('received from %s: %o', config.address, message)
if (!Array.isArray(message)) {
return
@ -118,10 +118,8 @@ export class StaticMirroringWorker implements IRunnable {
return
}
debug('received broadcast: %o', message.event)
const eventToRelay = createRelayedEventMessage(message.event as any, this.config.secret)
debug('relaying: %o', eventToRelay)
debug('relaying from %s to %s: %o', message.source, this.config.address, eventToRelay)
this.client.send(JSON.stringify(eventToRelay))
}