peterszombati / xapi-node

xStation5 Trading API for NodeJS/JS
https://peterszombati.github.io/xapi-node/
Other
58 stars 19 forks source link

indended to be used with logger4? #4

Closed maiopirata closed 4 years ago

maiopirata commented 4 years ago

Hello, nice package!

when I connect it with my account I get this message [xapi-node]: Logger path is not defined

Should you update the docs to explain why this happen? and if one is expected to use your logger package with this?

peterszombati commented 4 years ago

Hi! You can solve this by this code:

const logger = new Logger4({
    path: path.join(process.cwd(), 'logs'), // log files directory path
    directorySizeLimitMB: null
});

const x = new XAPI({
    ...loginConfig,
    logger
});

This happens because you are using NodeJS and Log directory is not configured for saving logs. Later will be available for other log modules.

peterszombati commented 4 years ago

@maiopirata https://github.com/peterszombati/xapi-node#how-to-use-other-log-modules-than-logger4

maiopirata commented 4 years ago

@peterszombati Thanks a lot! I will have a test in the next days.