_silence.js 291 B

123456789101112
  1. module.exports = function silence (logName, exports) {
  2. const logs = {}
  3. Object.keys(exports).forEach(key => {
  4. if (key !== 'error') {
  5. exports[key] = (...args) => {
  6. if (!logs[key]) logs[key] = []
  7. logs[key].push(args)
  8. }
  9. }
  10. })
  11. exports[logName] = logs
  12. }