metamigo-common: fix pretty deprecation error in pino logging
This commit is contained in:
parent
9c7a385c77
commit
a33f80c497
3 changed files with 6 additions and 10 deletions
|
|
@ -1,20 +1,15 @@
|
|||
import pino, { LoggerOptions } from "pino";
|
||||
import { IMetamigoConfig } from "./config/index.js";
|
||||
|
||||
export const getPrettyPrint = <T extends IMetamigoConfig>(
|
||||
config: T
|
||||
): boolean => {
|
||||
const { prettyPrint } = config.logging;
|
||||
if (prettyPrint === "auto") return config?.isDev || false;
|
||||
return prettyPrint === true;
|
||||
};
|
||||
|
||||
export const configureLogger = <T extends IMetamigoConfig>(
|
||||
config: T
|
||||
): pino.Logger => {
|
||||
const { level, redact } = config.logging;
|
||||
const options: LoggerOptions = {
|
||||
level,
|
||||
transport: {
|
||||
target: "pino-pretty",
|
||||
},
|
||||
redact: {
|
||||
paths: redact,
|
||||
remove: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue