Skip to content

Instantly share code, notes, and snippets.

@wesleytodd
Created August 25, 2016 14:24
Show Gist options
  • Save wesleytodd/8c610295d8a135b8c650ec0d3e574be9 to your computer and use it in GitHub Desktop.
Save wesleytodd/8c610295d8a135b8c650ec0d3e574be9 to your computer and use it in GitHub Desktop.
Thoughts on module level debugging
var module = require('module');
var logger = require('my-logger');

process.on('debug-log', function (log) {
  logger.debug(log);
});

Different setups have different requirements:

  • Log format
  • Output location
  • Process level metadata

By logging in a module, it becomes much more difficult to provide consistent solutions to the above problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment