configurable logLevel - defaults to error

This commit is contained in:
Michael Shanks 2020-05-29 14:06:25 +01:00
parent 6b00a079d1
commit cd9f539a09
3 changed files with 6 additions and 2 deletions

View File

@ -12,4 +12,7 @@ ADMIN_SECRET={{adminSecret}}
JWT_SECRET={{cookieKey1}}
# port to run http server on
PORT=4001
PORT=4001
# error level for koa-pino
LOG_LEVEL=error

View File

@ -5,3 +5,4 @@ process.env.JWT_SECRET = "test-jwtsecret"
process.env.CLIENT_ID = "test-client-id"
process.env.BUDIBASE_DIR = tmpdir("budibase-unittests")
process.env.ADMIN_SECRET = "test-admin-secret"
process.env.LOG_LEVEL = "silent"

View File

@ -15,7 +15,7 @@ app.use(
prettyPrint: {
levelFirst: true,
},
level: process.env.NODE_ENV === "jest" ? "silent" : "info",
level: env.LOG_LEVEL || "error",
})
)