pixtron / bybit-api

An unofficial node.js lowlevel wrapper for the Bybit Cryptocurrency Derivative exchange API
MIT License
21 stars 16 forks source link

Support logger from npm require #3

Closed tiagosiebler closed 4 years ago

tiagosiebler commented 4 years ago

Tiny enhancement based on #2. Lets you require the default logger via the import, for minimal partial overrides:

const { RestClient, WebsocketClient, DefaultLogger } = require('@pxtrn/bybit-api');

DefaultLogger.silly = () => {};

const API_KEY = 'xxx';
const PRIVATE_KEY = 'yyy';

const ws = new WebsocketClient({key: API_KEY, secret: PRIVATE_KEY}, DefaultLogger);

Updated readme too