Skip to content

Commit 0bfdae1

Browse files
feat(utilities): logger hijacks console.log with levels for suppressing debugging noise
1 parent 32c9987 commit 0bfdae1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

2020/helpers.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Suppress logging
2+
if (!process.env.DEBUG) {
3+
console.debug = () => {}
4+
console.info = () => {}
5+
}
6+
7+
module.exports = console
8+
// module.exports = {
9+
// debug: console.debug,
10+
// info: console.info,
11+
// log: console.log,
12+
// warn: console.warn,
13+
// error: console.error
14+
// }

0 commit comments

Comments
 (0)