Skip to content
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

feat: hide raw db query out from terminal #4347

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/generator/templates/app/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This env file should be checked into source control
# This is the place for default values for all environments
# Values in `.env.local` and `.env.production` will override these values
BLITZ_LOG_DISABLE_LEVEL="debug"
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,19 @@
import { rpcHandler } from "@blitzjs/rpc"
import { api } from "src/app/blitz-server"

export default api(rpcHandler({ onError: (error, ctx) => console.log(error) }))
const getBlitzLogLevel = (): "info" | "debug" | undefined => {
const requestedLevel = process.env.BLITZ_LOG_DISABLE_LEVEL
if (requestedLevel === "info" || requestedLevel === "debug") {
return requestedLevel
}
return undefined
}

export default api(
rpcHandler({
onError: (error, ctx) => console.log(error),
logging: {
disablelevel: getBlitzLogLevel(),
},
})
)
Loading