[enh] Add datetime infos on pushs

This commit is contained in:
2019-05-28 19:03:04 +02:00
parent 3f0321a94a
commit d2154c987b

View File

@@ -1,11 +1,12 @@
import {WS2PMessageHandler} from 'duniter/app/modules/ws2p/lib/impl/WS2PMessageHandler'
import {WS2PConnection} from 'duniter/app/modules/ws2p/lib/WS2PConnection'
import {WS2PResponse} from 'duniter/app/modules/ws2p/lib/impl/WS2PResponse'
import {NewLogger} from 'duniter/app/lib/logger'
export class MessageHandler implements WS2PMessageHandler {
async answerToRequest(json: any, c: WS2PConnection): Promise<WS2PResponse> {
console.log('Request from %s = %s', c.pubkey, JSON.stringify(json))
NewLogger().info('Request from %s = %s', c.pubkey, JSON.stringify(json))
return {}
}
@@ -13,7 +14,7 @@ export class MessageHandler implements WS2PMessageHandler {
* THAT'S THE CORE OF DWATCHER: tracing push messages
*/
async handlePushMessage(json: any, c: WS2PConnection): Promise<void> {
console.log('Push from %s = %s', c.pubkey, JSON.stringify(json))
NewLogger().info('Push from %s = %s', c.pubkey, JSON.stringify(json))
}
}