{"_rev":"4-4673183519fa9cf565f5c838494fa7c6","time":{"created":"2025-07-26T08:20:49.835Z","modified":"2025-07-26T08:20:50.554Z","1.0.0":"2025-07-26T08:15:00.474Z","1.0.1":"2025-07-26T08:20:50.195Z"},"_id":"@codemaniac-technologies/codemaniac-logger","name":"@codemaniac-technologies/codemaniac-logger","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@codemaniac-technologies/codemaniac-logger","version":"1.0.1","description":"> CODEMANIAC Logger Class for microservice and application logging.","main":"index.js","scripts":{"lint":"eslint --quiet --ignore-path .gitignore .","test":"nyc mocha --colors --recursive --timeout 10000 --reporter spec --exit","test-only":"mocha --colors --recursive --timeout 10000 --reporter spec --exit","security":"npm audit"},"prettier":{"printWidth":90,"tabWidth":2,"useTabs":false,"semi":true,"singleQuote":true,"trailingComma":"none","bracketSpacing":true,"jsxBracketSameLine":false,"arrowParens":"avoid","proseWrap":"preserve"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"npm run test"}},"lint-staged":{"*.{js,jsx,ts,tsx,md,html,css}":"prettier --write"},"repository":{"type":"git","url":"git+https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger.git"},"keywords":[],"author":{"name":"Codemaniac Technologies"},"license":"ISC","type":"commonjs","dependencies":{"continuation-local-storage":"^3.2.1","lodash":"^4.17.21","stack-trace":"^1.0.0-pre2","winston":"^2.3.0"},"devDependencies":{"chai":"^5.2.0","chai-arrays":"^2.2.0","chai-as-promised":"^8.0.1","codemaniac-eslint-plugin":"github:CodeManiac-Technologies-Pvt-Ltd/codemaniac-eslint-plugin","codemaniac-nyc":"github:CodeManiac-Technologies-Pvt-Ltd/codemaniac-nyc","eslint":"^9.27.0","husky":"^9.1.7","lint-staged":"^16.0.0","node-mocks-http":"^1.17.2","nyc":"^17.1.0","prettier":"^3.5.3","sinon":"^20.0.0"},"_id":"@codemaniac-technologies/codemaniac-logger@1.0.1","gitHead":"74934c830fe71f5cd8d68d2d63431224863c15ab","bugs":{"url":"https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger/issues"},"homepage":"https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger#readme","_nodeVersion":"22.16.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-k1JIIR995ypiO/yvZ3PtM6a3ENpbXDJ4m/efQCWiPrlidYPa12G+CRCmN24YjeOGmDDYiW9SF53KPYyFjoOo0Q==","shasum":"ac0537aa10a8b8092f584ccf77db1d76e298453a","tarball":"https://registry.npmjs.org/@codemaniac-technologies/codemaniac-logger/-/codemaniac-logger-1.0.1.tgz","fileCount":8,"unpackedSize":27444,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEAC9+DnL5R4uVQSS3bbvywdcRDwe/YMYoE5qmkmzkqGAiAyAWX81FUmdKpN/2ug9hkWUMJgWGc94pNKKCbEobE75w=="}]},"_npmUser":{"name":"dtanaji75","email":"dtanaji75@gmail.com"},"directories":{},"maintainers":[{"name":"codemaniac","email":"codemaniactechnologies@gmail.com"},{"name":"dtanaji75","email":"dtanaji75@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codemaniac-logger_1.0.1_1753518049998_0.5269043640153241"},"_hasShrinkwrap":false}},"maintainers":[{"name":"codemaniac","email":"codemaniactechnologies@gmail.com"},{"name":"dtanaji75","email":"dtanaji75@gmail.com"}],"description":"> CODEMANIAC Logger Class for microservice and application logging.","homepage":"https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger.git"},"author":{"name":"Codemaniac Technologies"},"bugs":{"url":"https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger/issues"},"license":"ISC","readme":"# **CODEMANIAC Logger**\n\n> CODEMANIAC Logger Class for microservice and application logging.\n\n## **Installation**\n\n1. Install as an NPM package using the main brach of the codemaniac-logger git repository:\n   ```bash\n   npm install --save https://github.com/CodeManiac-Technologies-Pvt-Ltd/codemaniac-logger.git\n   ```\n\n## **Dependencies**\n\n1. Node.js and NPM:\n\n   As with all of our modules, node.js and npm must be installed prior to use. If you've yet to install node or\n   would like a introduction, check out [Introducation to Node.js](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs) on node's official site.\n\n## **API**\n\n## Class: CMTLogger\n\nThis class is used to create an instance of the codemaniac logger.\n\n### Constructor:\n\n```js\nnew CMTLogger();\n```\n\nCreate a new logger object.\n\n- Returns: { CMTLogger}\n\n#### STATIC logger.errorLogger {Object}\n\n- Generic winston logger.\n\n#### STATIC logger.apiLogger {Function}\n\n- Request and Response logging Express middleware.\n\n#### logger.config {Object}\n\n- Config object registered with the logger instance.\n\n#### logger.logger {Object}\n\n- Initialized logger instance.\n\n#### logger.debugWhiteList {Array}\n\n- When in debug mode, whitelist of filenames to allow logging.\n\n#### logger.debugBlackList {Array}\n\n- When in debug mode, blacklist of filenames to prevent from logging.\n\n#### logger.logMessage(level, payLoad, ctx={}, encrSchema=null, category=null, root=null)\n\nPerforms logging with encryption as defined in the config for the instance.\n\n- `cronPattern` {String|Date} - Valid cron pattern string (see http://crontab.org/) or Date object.\n- `args` {...\\*} - Arguments to passed to the jobFunction when executing\n\n#### logger.init(paths, dirFilter, config, dataProtectService)\n\nUpdates the cronPattern or executation date for given job instance.\n\n- `cronPattern` {String|Date} - Valid cron pattern string (see http://crontab.org/) or Date object.\n\n## **Usage**\n\nTo use the logger, follow the below steps:\n\n1. Include the following in your application entrypoint file (usually `index.js`):\n   ```js\n   'use strict';\n   const CodemaniacLogger = require('codemaniac-logger');\n   const logger = new CodemaniacLogger();\n   scheduler.init(logConfig);\n   ```\n\n## Tests\n\n1. To run the test suite, first install dependencies the run `npm test`\n   ```bash\n   npm install\n   npm test\n   ```\n2. Analyze code coverage:\n\n   ```bash\n   npm run test-coverage\n   ```\n\n   An HTML copy of the coverage report will be written to the `./coverage` directory.\n\n3. Check adherance to style guidlines and detect potential problems:\n   ```bash\n   npm run lint\n   ```\n4. Check for known security exploits of dependent packages:\n   ```bash\n   npm run security\n   ```\n","readmeFilename":"README.md"}