pretty-print.js 504 B

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