1234567891011121314151617181920212223242526272829303132 |
- 'use strict';
- var format = require('./format');
- var _require = require('triple-beam'),
- MESSAGE = _require.MESSAGE;
- var jsonStringify = require('safe-stable-stringify');
- module.exports = format(function (info) {
- var stringifiedRest = jsonStringify(Object.assign({}, info, {
- level: undefined,
- message: undefined,
- splat: undefined
- }));
- var padding = info.padding && info.padding[info.level] || '';
- if (stringifiedRest !== '{}') {
- info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message, " ").concat(stringifiedRest);
- } else {
- info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message);
- }
- return info;
- });
|