debug-symbols

Combines the popular debug module and log-symbols to create colorized debug logs with matching symbols

Usage no npm install needed!

<script type="module">
  import debugSymbols from 'https://cdn.skypack.dev/debug-symbols';
</script>

README

Motivation

I built this small module because I wanted to use the popular debug module but extend it to:

  • Handle different log levels out of the box
  • Use colorization for different log levels (using chalk )
  • Add the amazing log-symbols symbols to logs.

Usage

This module merely extends Debug's usage and leaves all else intact.

const logger = require('debug-symbols')('namespace');

// Extend logger, Internally does debug.extend()
logger.extend('extend-to')

// This runs debug() as you might expect
logger.log('Default usage')

// Adding various log levels...
logger.debug('debug');
logger.info('info');
logger.warn('warn');
logger.error('error');
logger.fatal('fatal');
logger.fail('failed');
logger.success('success');

This will log something like this: