diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2016-12-31 03:35:19 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2016-12-31 03:35:19 +0900 |
| commit | 2765a3c2afc8721a4f6b021cb283e28289f5b1df (patch) | |
| tree | fd0c0b6d1ffd74b58b49cfb3994c52cc45d82163 /src/utils | |
| parent | Extract LastCommitInfo (diff) | |
| download | sharkey-2765a3c2afc8721a4f6b021cb283e28289f5b1df.tar.gz sharkey-2765a3c2afc8721a4f6b021cb283e28289f5b1df.tar.bz2 sharkey-2765a3c2afc8721a4f6b021cb283e28289f5b1df.zip | |
Extract EnvironmentInfo
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/environmentInfo.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/environmentInfo.ts b/src/utils/environmentInfo.ts new file mode 100644 index 0000000000..435bc9f49a --- /dev/null +++ b/src/utils/environmentInfo.ts @@ -0,0 +1,13 @@ +import Logger from './logger'; + +export default class EnvironmentInfo { + static show(): void { + const env = process.env.NODE_ENV; + let 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'); + } + } +} |