all files / clay-log/plugins/ heap.js

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                         
'use strict';
 
const v8 = require('v8');
 
const { wrap } = require('./_utils');
 
/**
 * Adds memory-use data from v8.getHeapStatistics to a log's context
 *
 * @param {object} data: The data to enhance.
 * @param {string} msg: The string summary of the log line.
 */
function wrapper(data, msg) {
  data = Object.assign(data, v8.getHeapStatistics());
}
 
module.exports = wrap(wrapper);