@ounch/logger
v1.0.1
Published
Reusable npm package to do logging to a file
Downloads
7
Readme
Ounch NPM Logger
Reusable npm package to do logging to a file
Usage
require('dotenv').config();
const {
initLogger,
insertLogger,
useLogger
} = require('@ounch/logger');
// Will have to initiate logger to set up Stream and Path
initLogger(process.env.APP_LOG_PATH)
// Direct Logger
insertLogger({}, {});
// Next Connect Middleware Function
useLogger({}, {}, () => {
return new Promise((resolve) => setTimeout(resolve, 1000))
});
// API Response JSON Interceptor
// const responseJsonInterceptor = (res, json) => (content) => {
// res.contentBody = content;
// res.json = json;
// res.json(content);
// };