�PNG  IHDR��;���IDATx��ܻn�0���K�� �)(�pA��� ���7�LeG{�� �§㻢|��ذaÆ 6lذaÆ 6lذaÆ 6lom��$^�y���ذag�5bÆ 6lذaÆ 6lذa{���� 6lذaÆ �`����}H�Fkm�,�m����Ӫ���ô�ô!� �x�|'ܢ˟;�E:���9�&ᶒ�}�{�v]�n&�6� �h��_��t�ڠ͵-ҫ���Z;��Z$�.�P���k�ž)�!��o���>}l�eQfJ�T��u і���چ��\��X=8��Rن4`Vw�l�>����n�G�^��i�s��"ms�$�u��i��?w�bs[m�6�K4���O���.�4��%����/����b�C%��t ��M�ז� �-l�G6�mrz2���s�%�9��s@���-�k�9�=���)������k�B5����\��+͂�Zsٲ ��Rn��~G���R���C����� �wIcI��n7jJ���hۛNCS|���j0��8y�iHKֶۛ�k�Ɉ+;Sz������L/��F�*\��Ԕ�#"5��m�2��[S��������=�g��n�a�P�e�ғ�L�� lذaÆ 6l�^k��̱aÆ 6lذaÆ 6lذa;���� �_��ذaÆ 6lذaÆ 6lذaÆ ���R���IEND�B` import util from 'util' import { parseStack } from '../utils/error' import { writeStream } from '../utils/stream' import { formatDate } from '../utils/date' const DEFAULTS = { dateFormat: 'HH:mm:ss', formatOptions: { date: true, colors: false, compact: true } } const bracket = x => x ? `[${x}]` : '' export default class BasicReporter { constructor (options) { this.options = Object.assign({}, DEFAULTS, options) } formatStack (stack) { return ' ' + parseStack(stack).join('\n ') } formatArgs (args) { const _args = args.map(arg => { if (arg && typeof arg.stack === 'string') { return arg.message + '\n' + this.formatStack(arg.stack) } return arg }) // Only supported with Node >= 10 // https://nodejs.org/api/util.html#util_util_inspect_object_options if (typeof util.formatWithOptions === 'function') { return util.formatWithOptions(this.options.formatOptions, ..._args) } else { return util.format(..._args) } } formatDate (date) { return this.options.formatOptions.date ? formatDate(this.options.dateFormat, date) : '' } filterAndJoin (arr) { return arr.filter(x => x).join(' ') } formatLogObj (logObj) { const message = this.formatArgs(logObj.args) return this.filterAndJoin([ bracket(logObj.type), bracket(logObj.tag), message ]) } log (logObj, { async, stdout, stderr } = {}) { const line = this.formatLogObj(logObj, { width: stdout.columns || 0 }) return writeStream( line + '\n', logObj.level < 2 ? stderr : stdout, async ? 'async' : 'default' ) } }