From 2a68ff87434fade5c81a34459690b6245aca5d86 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 23 Jul 2020 17:43:40 -0400 Subject: [PATCH] less extraneous data logs --- services/gunDB/contact-api/events/onReceivedReqs.js | 3 ++- services/gunDB/contact-api/events/onSentReqs.js | 7 +++---- services/gunDB/contact-api/streams/pubToFeed.js | 3 ++- services/gunDB/contact-api/streams/pubToIncoming.js | 5 ++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/services/gunDB/contact-api/events/onReceivedReqs.js b/services/gunDB/contact-api/events/onReceivedReqs.js index 6f7aaab7..9a18a29b 100644 --- a/services/gunDB/contact-api/events/onReceivedReqs.js +++ b/services/gunDB/contact-api/events/onReceivedReqs.js @@ -2,6 +2,7 @@ const debounce = require('lodash/debounce') const logger = require('winston') const { Schema } = require('shock-common') +const size = require('lodash/size') const Key = require('../key') const Streams = require('../streams') @@ -96,7 +97,7 @@ const listenerForAddr = addr => data => { } } - logger.info('data for address: ' + addr) + logger.info('data for address length: ' + size(addr)) logger.info(JSON.stringify(data, null, 4)) react() diff --git a/services/gunDB/contact-api/events/onSentReqs.js b/services/gunDB/contact-api/events/onSentReqs.js index 03686a2d..87c40dc1 100644 --- a/services/gunDB/contact-api/events/onSentReqs.js +++ b/services/gunDB/contact-api/events/onSentReqs.js @@ -1,6 +1,7 @@ /** @format */ const debounce = require('lodash/debounce') const logger = require('winston') +const size = require('lodash/size') const Streams = require('../streams') /** @@ -29,7 +30,7 @@ const listeners = new Set() let currentReqs = [] listeners.add(() => { - logger.info(`new sent reqs: ${JSON.stringify(currentReqs)}`) + logger.info(`new sent reqs length: ${currentReqs}`) }) const getCurrentSentReqs = () => currentReqs @@ -55,9 +56,7 @@ const react = debounce(() => { // pk to display name const pubToDN = Streams.getPubToDn() - logger.info( - `pubToLastSentREqID: ${JSON.stringify(pubToLastSentReqID, null, 4)}` - ) + logger.info(`pubToLastSentREqID length: ${size(pubToLastSentReqID)}`) for (const storedReq of storedReqs) { const { handshakeAddress, recipientPub, sentReqID, timestamp } = storedReq diff --git a/services/gunDB/contact-api/streams/pubToFeed.js b/services/gunDB/contact-api/streams/pubToFeed.js index 30e49394..f6f96cc4 100644 --- a/services/gunDB/contact-api/streams/pubToFeed.js +++ b/services/gunDB/contact-api/streams/pubToFeed.js @@ -3,6 +3,7 @@ const uuidv1 = require('uuid/v1') const logger = require('winston') const debounce = require('lodash/debounce') const { Schema, Utils: CommonUtils } = require('shock-common') +const size = require('lodash/size') const Key = require('../key') const Utils = require('../utils') @@ -29,7 +30,7 @@ let pubToFeed = {} const getPubToFeed = () => pubToFeed feedsListeners.add(() => { - logger.info(`new pubToFeed: ${JSON.stringify(getPubToFeed())}`) + logger.info(`new pubToFeed length: ${size(getPubToFeed())}`) }) /** @param {Feeds} ptf */ diff --git a/services/gunDB/contact-api/streams/pubToIncoming.js b/services/gunDB/contact-api/streams/pubToIncoming.js index 72b18b9d..2834ca79 100644 --- a/services/gunDB/contact-api/streams/pubToIncoming.js +++ b/services/gunDB/contact-api/streams/pubToIncoming.js @@ -3,6 +3,7 @@ const uuidv1 = require('uuid/v1') const debounce = require('lodash/debounce') const logger = require('winston') const { Utils: CommonUtils } = require('shock-common') +const size = require('lodash/size') const { USER_TO_INCOMING } = require('../key') /** @typedef {import('../SimpleGUN').OpenListenerData} OpenListenerData */ @@ -30,9 +31,7 @@ const setPubToIncoming = pti => { let latestUpdate = uuidv1() listeners.add(() => { - logger.info( - `new pubToIncoming: ${JSON.stringify(getPubToIncoming(), null, 4)}` - ) + logger.info(`new pubToIncoming length: ${size(getPubToIncoming())}`) }) const onOpen = debounce(async uti => {