@strapi/logger
Advanced tools
Comparing version 4.25.18 to 4.25.19
@@ -1,4 +0,4 @@ | ||
import { LoggerOptions } from 'winston'; | ||
declare const _default: (filename: string) => LoggerOptions; | ||
import { transports, LoggerOptions } from 'winston'; | ||
declare const _default: (filename: string, fileTransportOptions?: transports.FileTransportOptions) => LoggerOptions; | ||
export default _default; | ||
//# sourceMappingURL=output-file-configuration.d.ts.map |
@@ -5,2 +5,3 @@ export { default as prettyPrint } from './pretty-print'; | ||
export { default as excludeColors } from './exclude-colors'; | ||
export { default as detailedLogs } from './detailed-log'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -68,4 +68,16 @@ "use strict"; | ||
}); | ||
const detailedLog = winston.format.printf(({ message, level, timestamp }) => { | ||
if (typeof message !== "string") { | ||
return message; | ||
} | ||
const newMessage = `[${timestamp}] ${level}: ${message}`; | ||
return newMessage.replace( | ||
// eslint-disable-next-line no-control-regex | ||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, | ||
"" | ||
); | ||
}); | ||
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ | ||
__proto__: null, | ||
detailedLogs: detailedLog, | ||
excludeColors, | ||
@@ -83,3 +95,3 @@ levelFilter, | ||
}; | ||
const outputFileConfiguration = (filename) => { | ||
const outputFileConfiguration = (filename, fileTransportOptions = {}) => { | ||
return { | ||
@@ -91,3 +103,8 @@ level: LEVEL_LABEL, | ||
new winston.transports.Console(), | ||
new winston.transports.File({ level: "error", filename, format: excludeColors }) | ||
new winston.transports.File({ | ||
level: "error", | ||
filename, | ||
format: excludeColors, | ||
...fileTransportOptions | ||
}) | ||
] | ||
@@ -94,0 +111,0 @@ }; |
{ | ||
"name": "@strapi/logger", | ||
"version": "4.25.18", | ||
"version": "4.25.19", | ||
"description": "Strapi's logger", | ||
@@ -46,4 +46,4 @@ "homepage": "https://strapi.io", | ||
"@strapi/pack-up": "4.23.0", | ||
"eslint-config-custom": "4.25.18", | ||
"tsconfig": "4.25.18" | ||
"eslint-config-custom": "4.25.19", | ||
"tsconfig": "4.25.19" | ||
}, | ||
@@ -54,3 +54,3 @@ "engines": { | ||
}, | ||
"gitHead": "402494d20bd9a5e84dba7a79514325556d4f0331" | ||
"gitHead": "e033e9b9c89837331a60b1b6a2c21a779fffc801" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29924
28
288