@@ -50,11 +50,8 @@ assert.ok(process.env.AUTH0_CLIENT_ID);
5050assert . ok ( process . env . AUTH0_CLIENT_SECRET ) ;
5151assert . ok ( process . env . AUTH0_DOMAIN ) ;
5252assert . ok ( process . env . API_LOCATION ) ;
53- assert . ok ( process . env . FCC_ENABLE_SWAGGER_UI ) ;
54- assert . ok ( process . env . FCC_ENABLE_DEV_LOGIN_MODE ) ;
5553assert . ok ( process . env . JWT_SECRET ) ;
5654assert . ok ( process . env . STRIPE_SECRET_KEY ) ;
57- assert . ok ( process . env . SHOW_UPCOMING_CHANGES ) ;
5855assert . ok ( process . env . MONGOHQ_URL ) ;
5956assert . ok ( process . env . COOKIE_SECRET ) ;
6057
@@ -68,13 +65,15 @@ const LOG_LEVELS: LogLevel[] = [
6865 'silent'
6966] as const ;
7067
71- function assertLogLevel ( level : unknown ) : level is LogLevel {
72- return typeof level === 'string' && LOG_LEVELS . includes ( level ) ;
68+ function isLogLevel ( level : string ) : level is LogLevel {
69+ return LOG_LEVELS . includes ( level ) ;
7370}
7471
72+ const LOG_LEVEL = process . env . FCC_API_LOG_LEVEL || 'info' ;
73+
7574assert . ok (
76- assertLogLevel ( process . env . FCC_API_LOG_LEVEL ) ,
77- `FCC_API_LOG_LEVEL must be one of ${ LOG_LEVELS . join ( ',' ) } . Found ${ process . env . FCC_API_LOG_LEVEL } `
75+ isLogLevel ( LOG_LEVEL ) ,
76+ `FCC_API_LOG_LEVEL must be one of ${ LOG_LEVELS . join ( ', ' ) } . Found ${ LOG_LEVEL } `
7877) ;
7978
8079if ( process . env . FREECODECAMP_NODE_ENV !== 'development' ) {
@@ -157,7 +156,7 @@ export const FCC_ENABLE_EXAM_ENVIRONMENT =
157156 process . env . FCC_ENABLE_EXAM_ENVIRONMENT === 'true' ;
158157export const FCC_ENABLE_SENTRY_ROUTES =
159158 process . env . FCC_ENABLE_SENTRY_ROUTES === 'true' ;
160- export const FCC_API_LOG_LEVEL = process . env . FCC_API_LOG_LEVEL ;
159+ export const FCC_API_LOG_LEVEL = LOG_LEVEL ;
161160export const SENTRY_DSN =
162161 process . env . SENTRY_DSN === 'dsn_from_sentry_dashboard'
163162 ? ''
0 commit comments