mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 12:13:31 +08:00
chore(api): add log level configuration
This commit is contained in:
+8
-4
@@ -4,7 +4,12 @@
|
||||
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
||||
/// <reference path="./reset.d.ts" />
|
||||
import { build } from './app';
|
||||
import { FREECODECAMP_NODE_ENV, HOST, PORT } from './utils/env';
|
||||
import {
|
||||
FREECODECAMP_NODE_ENV,
|
||||
FCC_API_LOG_LEVEL,
|
||||
HOST,
|
||||
PORT
|
||||
} from './utils/env';
|
||||
|
||||
const envToLogger = {
|
||||
development: {
|
||||
@@ -15,10 +20,9 @@ const envToLogger = {
|
||||
ignore: 'pid,hostname'
|
||||
}
|
||||
},
|
||||
level: 'debug'
|
||||
level: FCC_API_LOG_LEVEL
|
||||
},
|
||||
// TODO: is this the right level for production or should we use 'error'?
|
||||
production: { level: 'fatal' },
|
||||
production: { level: FCC_API_LOG_LEVEL },
|
||||
test: undefined
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user