caobo171 / node-zklib

This is a lightweight of node.js module to connect to biometrix attendance device for examples ZKTeco
70 stars 59 forks source link

Logs writing should be controllable #7

Closed emahuni closed 4 years ago

emahuni commented 4 years ago

There is an issue whereby logs are being written without a way to control them. There should be an option to control writing of error logs; the path and whether to write the logs or not.

caobo171 commented 4 years ago

I don't understand your idea , can you explain it more clearly , thank you !

mementototem commented 4 years ago

When some error happen like ECONNRESET (from net.Socket itself) or TIMEOUT, we unable to catch it, error was print to console and resolved.

emahuni commented 4 years ago

Actually a log file is being written by this script: https://github.com/caobo171/node-zklib/blob/master/helpers/errorLog.js this is what I am referring to. If you notice in the repo, there is such a log file, which is rather undesirable, especially if the lib is being used in an app that is using a watch. It makes other error handlers useless as the watch restarts the app due to the modified or new file. Some times I just don't want any files written though it's fine. Therefore a way to control this is welcome.

caobo171 commented 4 years ago

@emahuni do you have any ideas ? Because the core of this lib is just zklib , the others are just helper functions and it's used in my case :))