triple-beam

Definitions of levels for logging purposes & shareable Symbol constants.

MIT 7 个版本
安装
npm install triple-beam
yarn add triple-beam
pnpm add triple-beam
bun add triple-beam
README

triple-beam

Definitions of levels for logging purposes & shareable Symbol constants.

Usage

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

Tests are written with mocha, assume, and nyc. They can be run with npm:

npm test
LICENSE: MIT
AUTHOR: Charlie Robbins
版本列表
1.4.1 2023-07-10
1.4.0 2023-07-10
1.3.0 2018-05-24
1.2.0 2018-04-25
1.1.0 2017-09-30
1.0.1 2017-09-29
1.0.0 2017-09-29