This project provides a simple function for nodejs where you can automatically write the error message, error code, error date and formatted error date to a file.
yarn add error-printer
yarn test
yarn start
(in ES6)
import error_log from "error-printer";
try {
// ... any codes
} catch(err) {
error_log({
message: err.message
});
}