I am using Binance Node.js API and websocket, but I always getthe message
'Completed keep alive cycle for listenKey(TZbi36E773J4pVkD8ZacgrnAhQ9YlvR82q50lw6z9Nno89WIni8K0d65xXfE) in market(spot)',
{
category: 'binance-ws',
listenKey: 'TZbi36E773J4pVkD8ZacgrnAhQ9YlvR82q50lw6z9Nno89WIni8K0d65xXfE'
}
]
How can I get rid of that? I want to print only my own logs the I call myself using colsole.log('blabla')
to the console.
I use it like this
const { WebsocketClient } = require('binance');
const wsClient = new WebsocketClient(
{
api_key: key,
api_secret: secret,
beautify: true,
// Disable ping/pong ws heartbeat mechanism (not recommended)
// disableHeartbeat: true
},
);
...
...
...
wsClient.on('message', (data) => {
//bla bla
}
I am using Binance Node.js API and websocket, but I always getthe message
'Completed keep alive cycle for listenKey(TZbi36E773J4pVkD8ZacgrnAhQ9YlvR82q50lw6z9Nno89WIni8K0d65xXfE) in market(spot)',
{
category: 'binance-ws',
listenKey: 'TZbi36E773J4pVkD8ZacgrnAhQ9YlvR82q50lw6z9Nno89WIni8K0d65xXfE'
}
]
How can I get rid of that? I want to print only my own logs the I call myself using colsole.log('blabla')
to the console.
I use it like this
const { WebsocketClient } = require('binance');
const wsClient = new WebsocketClient(
{
api_key: key,
api_secret: secret,
beautify: true,
// Disable ping/pong ws heartbeat mechanism (not recommended)
// disableHeartbeat: true
},
);
...
...
...
wsClient.on('message', (data) => {
//bla bla
}
Share
Improve this question
edited Mar 27 at 9:03
Mureinik
313k54 gold badges364 silver badges393 bronze badges
asked Mar 4 at 11:14
SunnyBeachTaxiSunnyBeachTaxi
251 silver badge3 bronze badges
1 Answer
Reset to default 1You can override the logger and have the lower log levels (or all of them) do nothing:
const { WebsocketClient, DefaultLogger } = require('binance');
const doNothing = (...params) => {};
const logger = {
...DefaultLogger,
silly: doNothing,
debug: doNothing,
notice: doNothing,
info: doNothing
};
const wsClient = new WebsocketClient(
{
api_key: key,
api_secret: secret,
beautify: true
},
logger
);