apinew / logger.js
sjsjd's picture
hello
59485cb
raw
history blame contribute delete
280 Bytes
exports.error = (next, message, status = 500) => {
const error = new Error(message);
error.status = status;
next(error);
};
exports.log = (data, type) => {
const log = console.log('\x1b[37m → \x1b[32m' + type.toUpperCase() + '\x1b[37m -\x1b[0m', data);
next(log);
};