Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBetter logging #91
Better logging #91
Conversation
75a6ce4
to
94ebd46
|
Hi @oleksiyk. Thanks for this work on logging! I'm in the process of a big refactor using ES6 and adding a better abstraction around active/passive data connections. I can take a closer look at this diff soon and possibly merge it into master, but I think the new branch will actually become the master branch in the near future, so we may need to manually add this feature to that branch at some point. |
|
Hi Simon! |
|
No, not dropping support for v0.10. I'll continue to support all the versions we support now. The ES6 features will be transformed to valid ES5 before publishing to NPM. |
|
Ok, let me know what you decide. I will adapt this one for ES6 branch or create new PR. |
oleksiyk commentedFeb 13, 2016
This makes nodeftpd to log messages like this:
Each message consists of 5 space separated fields:
Messages are logged in color to TTY and without any color escape sequences when stdout/stderr is redirected to file.
Several new options added:
ttyColors: boolean, set tofalseto force disable coloured outputlogFunction: function, overwrite default function used to log messages. Receives 4 arguments: level, remote ip, authenticated user, message.logLeveloption remains the same: from 0 (just errors) to 4 (trace)I've also used sinon to verify logged messages in some tests instead of old method:
oleksiyk@df873e5#diff-51ecdc1506ecf5aaebb57c019653fbe6L124
Logging level can also be redefined with NODEFTPD_LOG_LEVEL environment variable.