diff --git a/src/adapters/web-server-adapter.ts b/src/adapters/web-server-adapter.ts index 5b0beb18..28be6475 100644 --- a/src/adapters/web-server-adapter.ts +++ b/src/adapters/web-server-adapter.ts @@ -33,7 +33,7 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter } private onRequest(request: IncomingMessage, response: ServerResponse) { - debug('request received: %o', request) + debug('request received: %O', request.rawHeaders) if (request.method === 'GET' && request.headers['accept'] === 'application/nostr+json') { const { info: { name, description, pubkey, contact }, @@ -56,7 +56,6 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter response.setHeader('content-type', 'application/text') response.end('Please use a Nostr client to connect.') } - debug('send response: %o', response) } private onError(error: Error, socket: Duplex) { diff --git a/src/adapters/web-socket-adapter.ts b/src/adapters/web-socket-adapter.ts index adab4ea1..02a312ce 100644 --- a/src/adapters/web-socket-adapter.ts +++ b/src/adapters/web-socket-adapter.ts @@ -17,6 +17,7 @@ import { isEventMatchingFilter } from '../utils/event' import { messageSchema } from '../schemas/message-schema' const debug = createLogger('web-socket-adapter') +const debugHeartbeat = debug.extend('heartbeat') export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter { public clientId: string @@ -103,7 +104,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter this.alive = false this.client.ping() - debug('client %s ping', this.clientId) + debugHeartbeat('client %s ping', this.clientId) } public getSubscriptions(): Map { @@ -145,7 +146,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter } private onClientPong() { - debug('client %s pong', this.clientId) + debugHeartbeat('client %s pong', this.clientId) this.alive = true }