Skip to content

Commit

Permalink
JS Helper Library - Init #39
Browse files Browse the repository at this point in the history
  • Loading branch information
TanmoySG committed Jun 17, 2022
1 parent 4b58c9f commit ddbae0b
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libraries/js/logsmith.js
Original file line number Diff line number Diff line change
@@ -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"))
34 changes: 34 additions & 0 deletions libraries/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions libraries/js/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit ddbae0b

Please sign in to comment.