You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
291 B

3 months ago
  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. }