From aa4ef6745ad798bd7d4f05cb397ef1dd85279814 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Jul 2018 19:19:00 +0900 Subject: Refactorng --- src/misc/environmentInfo.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/misc/environmentInfo.ts (limited to 'src/misc/environmentInfo.ts') diff --git a/src/misc/environmentInfo.ts b/src/misc/environmentInfo.ts new file mode 100644 index 0000000000..e6084cde0e --- /dev/null +++ b/src/misc/environmentInfo.ts @@ -0,0 +1,14 @@ +import Logger from './logger'; + +export default class { + public static show(): void { + const env = process.env.NODE_ENV; + const logger = new Logger('Env'); + logger.info(typeof env == 'undefined' ? 'NODE_ENV is not set' : `NODE_ENV: ${env}`); + + if (env !== 'production') { + logger.warn('The environment is not in production mode'); + logger.warn('Do not use for production purpose'); + } + } +} -- cgit v1.2.3-freya