Skip to content

Commit

Permalink
Add packages/logger
Browse files Browse the repository at this point in the history
  • Loading branch information
erzhtor committed Jan 5, 2019
1 parent 601b3bd commit 7085a9d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/logger/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const CYAN = '\x1b[36m';
const RED = '\x1b[31m';
const YELLOW = '\x1b[33m';

const log = (color, ...args) => console.log(color + '%s', ...args);

exports.info = (...args) => log(CYAN, ...args);
exports.warn = (...args) => log(YELLOW, ...args);
exports.error = (...args) => log(RED, ...args);
12 changes: 12 additions & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@my-project/logger",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

0 comments on commit 7085a9d

Please sign in to comment.