lukaaash / sftp-ws

SFTP over WebSockets - client and server package for Node.js
MIT License
34 stars 16 forks source link

Log Output is Formatted Incorrectly when using Winston 3.3.3 Logging #9

Open GuyPaddock opened 4 years ago

GuyPaddock commented 4 years ago

Reading through LogHelper in lib/util.ts, it looks like this project is intended to support the following log backends:

However, if you try to use Winston 3.3.3 with it, any log output that includes sprintf-style format messages does not output correctly. My guess is that the project assumes that Winston supports this style of logging when, in fact, it does not.

For example, line 283 of lib/sftp.ts:

                this._log.debug("Accepted connection from %s:%d", con.remoteAddress, con.remotePort);

... prints out as:

Accepted connection from %s:%d

As a side note, Winston emits a warning any time that it receives trace-level log output:

[winston] Unknown logger level: trace