root 3bf41bf355 update | il y a 1 an | |
---|---|---|
.. | ||
config | il y a 1 an | |
.eslintrc | il y a 1 an | |
.gitattributes | il y a 1 an | |
.travis.yml | il y a 1 an | |
CHANGELOG.md | il y a 1 an | |
LICENSE | il y a 1 an | |
README.md | il y a 1 an | |
index.js | il y a 1 an | |
package.json | il y a 1 an | |
test.js | il y a 1 an |
Definitions of levels for logging purposes & shareable Symbol constants.
const { LEVEL } = require('triple-beam');
const colors = require('colors/safe');
const info = {
[LEVEL]: 'error',
level: 'error',
message: 'hey a logging message!'
};
// Colorize your log level!
info.level = colors.green(info.level);
// And still have an unmutated copy of your level!
console.log(info.level === 'error'); // false
console.log(info[LEVEL] === 'error'); // true
Tests are written with mocha
, assume
, and nyc
. They can be run with npm
:
npm test