2021-07-09 15:49:42 +00:00
|
|
|
import { Logger } from "tslog";
|
|
|
|
|
2021-12-01 10:32:08 +00:00
|
|
|
import { IS_PRODUCTION } from "@lib/config/constants";
|
2021-07-09 15:49:42 +00:00
|
|
|
|
|
|
|
const logger = new Logger({
|
|
|
|
dateTimePattern: "hour:minute:second.millisecond timeZoneName",
|
|
|
|
displayFunctionName: false,
|
|
|
|
displayFilePath: "hidden",
|
2021-12-01 10:32:08 +00:00
|
|
|
dateTimeTimezone: IS_PRODUCTION ? "utc" : Intl.DateTimeFormat().resolvedOptions().timeZone,
|
2021-07-09 15:49:42 +00:00
|
|
|
prettyInspectHighlightStyles: {
|
|
|
|
name: "yellow",
|
|
|
|
number: "blue",
|
|
|
|
bigint: "blue",
|
|
|
|
boolean: "blue",
|
|
|
|
},
|
|
|
|
maskValuesOfKeys: ["password", "passwordConfirmation", "credentials", "credential"],
|
2021-12-01 10:32:08 +00:00
|
|
|
exposeErrorCodeFrame: !IS_PRODUCTION,
|
2021-07-09 15:49:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export default logger;
|