Allows to override default debug level for logger (#6300)

pull/6294/head
Omar López 2023-01-05 16:23:50 -07:00 committed by GitHub
parent f72f709e34
commit b77ce4a010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -3,8 +3,8 @@ import { Logger } from "tslog";
import { IS_PRODUCTION } from "./constants";
const logger = new Logger({
minLevel: "warn",
dateTimePattern: "hour:minute:second.millisecond timeZoneName",
minLevel: !!process.env.NEXT_PUBLIC_DEBUG ? "debug" : "warn",
dateTimePattern: "hour:minute:second.millisecond",
displayFunctionName: false,
displayFilePath: "hidden",
dateTimeTimezone: IS_PRODUCTION ? "utc" : Intl.DateTimeFormat().resolvedOptions().timeZone,