aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/log.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/log.js')
-rw-r--r--frontend/src/log.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/frontend/src/log.js b/frontend/src/log.js
index 424e1b4..0afac47 100644
--- a/frontend/src/log.js
+++ b/frontend/src/log.js
@@ -16,9 +16,14 @@
*/
const log = {
- debug: (...obj) => console.info(...obj),
+ debug: (...obj) => isDevelopment() && console.info(...obj),
info: (...obj) => console.info(...obj),
+ warn: (...obj) => console.warn(...obj),
error: (...obj) => console.error(obj)
};
+function isDevelopment() {
+ return !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
+}
+
export default log;