newStaffLDB-API #48
@ -3,12 +3,19 @@ import pino from "pino";
|
|||||||
const runtime = process.env.NODE_ENV
|
const runtime = process.env.NODE_ENV
|
||||||
let level: string
|
let level: string
|
||||||
if (runtime === "production") {
|
if (runtime === "production") {
|
||||||
level = "warning"
|
level = "info"
|
||||||
} else {
|
} else {
|
||||||
level = "debug"
|
level = "debug"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Runtime mode: ${runtime || "dev"}, Log Level: ${level}`)
|
||||||
|
|
||||||
export const logger = pino({
|
export const logger = pino({
|
||||||
name: 'owlboard',
|
|
||||||
level: level,
|
level: level,
|
||||||
|
formatters: {
|
||||||
|
level: (label) => {
|
||||||
|
return { level: label.toUpperCase()}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
timestamp: pino.stdTimeFunctions.isoTime,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user