dbaas
Version:
Database as a service. Expose db to REST and GraphQL.
19 lines • 680 B
JavaScript
import { pino } from "pino";
// import pinoColada from "pino-colada"
const isPrettyLog = process.env["LOG_STYLE"] === "pretty";
const isTest = process.env["NODE_ENV"] === "test";
export const defaultOptions = {
// turn off during running jest
enabled: !isTest,
base: undefined,
timestamp: isPrettyLog
? () => pino.stdTimeFunctions.isoTime().replace("T", " ")
: true,
// TODO: What to replace this flag?
// prettyPrint: isPrettyLog,
// prettifier: isPrettyLog ? pinoColada : undefined,
};
export default function createLogger(name, opts) {
return pino({ ...defaultOptions, name, ...opts });
}
//# sourceMappingURL=createLogger.js.map