diff --git a/libraries/js/logsmith.js b/libraries/js/logsmith.js new file mode 100644 index 0000000..7d54a23 --- /dev/null +++ b/libraries/js/logsmith.js @@ -0,0 +1,19 @@ +import chalk from 'chalk'; + +// +// "WARNING": "yellow", +// "INFO": "blue", +// "SUCCESS": "green", +// "FAILURE": "red", +// "CRITICAL": "grey" +// + +const logLevels = { + WARN: chalk.red, + INFO: chalk.blue, + CRITICAL : chalk.bgRed.gray +} + +console.log(logLevels.INFO("test")) +console.log(logLevels.WARN("warn")) +console.log(logLevels.CRITICAL("crit")) \ No newline at end of file diff --git a/libraries/js/package-lock.json b/libraries/js/package-lock.json new file mode 100644 index 0000000..8e4ef10 --- /dev/null +++ b/libraries/js/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "logsmith.js", + "version": "0.0.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "logsmith.js", + "version": "0.0.1", + "license": "ISC", + "dependencies": { + "chalk": "^5.0.1" + } + }, + "node_modules/chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + } + }, + "dependencies": { + "chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" + } + } +} diff --git a/libraries/js/package.json b/libraries/js/package.json new file mode 100644 index 0000000..4b2ed94 --- /dev/null +++ b/libraries/js/package.json @@ -0,0 +1,20 @@ +{ + "name": "logsmith.js", + "version": "0.0.1", + "description": "Logging Library for NodeJS Projects with logsmith-monitor support.", + "main": "logsmith.js", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "logging", + "logger", + "monitor" + ], + "author": "Tanmoy Sen Gupta", + "license": "ISC", + "dependencies": { + "chalk": "^5.0.1" + } +}