- 🚀 Speed start new project or package using typescript
- 🚨 Over 800 rules for pattern, possible errors and errors in Linter
- 🎇 Log Pattern default format
- Node.js 16 or later
- Yarn Optional/Recommended
- ODG TsConfig Last Version
- error-stack-parser Last Version
install this plugin with
yarn add @odg/json-log
const logger = new Logger(); // Or Other Class Logger
const consoleLogger = new ConsoleLogger(); // Or Other Class Logger
const processor = new JSONLoggerPlugin(
"appName",
);
logger.pushHandler(consoleLogger);
logger.pushProcessor(processor);
// If you need convert Request and response request headers body, params in string before log
logger.pushProcessor(RequestStringPlugin);
plugin.setIdentifier(randomUUID());
try {
throw new Exception("Example");
} catch (error) {
await logger.error(error);
}
LOG JSON Return
Copy .env.example
to .env
and add the values according to your needs.
First install dependencies with the following command
yarn install
# or
npm install
To build the project, you can use the following command
if you change files, you need to run
yarn build
andyarn start
again
yarn build && yarn start
# or
yarn dev
To Test execute this command
yarn test
# or
yarn test:watch