Skip to content

logger 1.0.2

Install from the command line:
Learn more about npm packages
$ npm install @dexare/logger@1.0.2
Install via package.json:
"@dexare/logger": "1.0.2"

About this version

A Dexare module for colorful logging with winston and chalk.

npm install @dexare/logger
const { DexareClient } = require('dexare');
const LoggerModule = require('@dexare/logger');

const config = {
  // All props in this config are optional, defaults are shown unless told otherwise
  logger: {
    // The level to log at, defaults to 'info' if process.env.NODE_ENV is 'production'
    level: 'debug',
    // The options object for util.inspect
    inspectOptions: {}
  }
}

const client = new DexareClient(config);
client.loadModules(LoggerModule);
// ...

// You can set the color of a module or level by defining it
// in `module.moduleColors` and `module.levelColors` respectively
const chalk = require('chalk');
const logger = client.modules.get('logger');
logger.moduleColors.info = chalk.black.bgCyan;

// Loggers are also created per module in `winston.loggers`.

Details


Assets

  • logger-1.0.2-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all