Neverending Perpetual Motion

    @dexare/logger
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    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`.

    Install

    npm i @dexare/logger

    DownloadsWeekly Downloads

    8

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    16 kB

    Total Files

    8

    Last publish

    Collaborators

    • snazzah