Skip to content

Fix/continue #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
fix log due to env being prod
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Apr 18, 2020
commit 64409c9e99a7b70e1c22acb6dbcd37e2fb1aa980
3 changes: 1 addition & 2 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export type Env = 'test' | 'local' | 'development' | 'production'
export const NODE_ENV: Env = process.env.NODE_ENV || 'production'

// toggle logging in development
export const LOG: boolean =
(process.env.REACT_APP_LOG || '').toLowerCase() === 'true' && process.env.NODE_ENV !== 'production'
export const LOG: boolean = (process.env.REACT_APP_LOG || '').toLowerCase() === 'true'

// error logging tool
export const SENTRY_DSN: string | null = process.env.SENTRY_DSN || null
Expand Down
3 changes: 1 addition & 2 deletions web-app/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ for (const required of requiredKeys) {
export const DEBUG: boolean = (process.env.REACT_APP_DEBUG || '').toLowerCase() === 'true'
export const VERSION: string = process.env.VERSION || 'unknown'
export const NODE_ENV: string = process.env.NODE_ENV || 'development'
export const LOG: boolean =
(process.env.REACT_APP_LOG || '').toLowerCase() === 'true' && process.env.NODE_ENV !== 'production'
export const LOG: boolean = (process.env.REACT_APP_LOG || '').toLowerCase() === 'true'
export const TUTORIAL_LIST_URL: string = process.env.REACT_APP_TUTORIAL_LIST_URL || ''
export const SENTRY_DSN: string | null = process.env.REACT_APP_SENTRY_DSN || null
9 changes: 8 additions & 1 deletion web-app/src/services/logger/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LOG } from '../../environment'
import { LOG, VERSION, NODE_ENV } from '../../environment'

export type Log = string | object

Expand All @@ -17,4 +17,11 @@ const logger = (...messages: Log[]): void => {
}
}

logger(`
ENV
---
VERSION: ${VERSION}
NODE_ENV: ${NODE_ENV}
`)

export default logger