pretty-print.js 535 B

1234567891011121314151617181920
  1. 'use strict';
  2. var inspect = require('util').inspect;
  3. var format = require('./format');
  4. var _require = require('triple-beam'),
  5. MESSAGE = _require.MESSAGE;
  6. /*
  7. * function prettyPrint (info)
  8. * Returns a new instance of the prettyPrint Format that "prettyPrint"
  9. * serializes `info` objects. This was previously exposed as
  10. * { prettyPrint: true } to transports in `winston < 3.0.0`.
  11. */
  12. module.exports = format(function (info, opts) {
  13. info[MESSAGE] = inspect(info, false, opts.depth || null, opts.colorize);
  14. return info;
  15. });