@strapi/logger
Advanced tools
Comparing version 0.0.0-next.5c5ae949bfec6a57131caacae14a36e8c1465080 to 0.0.0-next.5d0cd5a1a7d80ae3da90f2331d25161b28f06910
@@ -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 |
@@ -5,4 +5,3 @@ "use strict"; | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) | ||
return e; | ||
if (e && e.__esModule) return e; | ||
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } }); | ||
@@ -69,4 +68,16 @@ if (e) { | ||
}); | ||
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, | ||
@@ -84,3 +95,3 @@ levelFilter, | ||
}; | ||
const outputFileConfiguration = (filename) => { | ||
const outputFileConfiguration = (filename, fileTransportOptions = {}) => { | ||
return { | ||
@@ -92,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 | ||
}) | ||
] | ||
@@ -95,0 +111,0 @@ }; |
{ | ||
"name": "@strapi/logger", | ||
"version": "0.0.0-next.5c5ae949bfec6a57131caacae14a36e8c1465080", | ||
"version": "0.0.0-next.5d0cd5a1a7d80ae3da90f2331d25161b28f06910", | ||
"description": "Strapi's logger", | ||
@@ -31,3 +31,3 @@ "homepage": "https://strapi.io", | ||
"files": [ | ||
"./dist" | ||
"dist/" | ||
], | ||
@@ -38,3 +38,2 @@ "scripts": { | ||
"lint": "run -T eslint .", | ||
"prepublishOnly": "yarn clean && yarn build", | ||
"test:ts": "run -T tsc --noEmit", | ||
@@ -48,11 +47,11 @@ "watch": "pack-up watch" | ||
"devDependencies": { | ||
"@strapi/pack-up": "0.0.0-next.5c5ae949bfec6a57131caacae14a36e8c1465080", | ||
"eslint-config-custom": "0.0.0-next.5c5ae949bfec6a57131caacae14a36e8c1465080", | ||
"tsconfig": "0.0.0-next.5c5ae949bfec6a57131caacae14a36e8c1465080" | ||
"@strapi/pack-up": "5.0.2", | ||
"eslint-config-custom": "0.0.0-next.5d0cd5a1a7d80ae3da90f2331d25161b28f06910", | ||
"tsconfig": "0.0.0-next.5d0cd5a1a7d80ae3da90f2331d25161b28f06910" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0 <=20.x.x", | ||
"node": ">=18.0.0 <=22.x.x", | ||
"npm": ">=6.0.0" | ||
}, | ||
"gitHead": "5c5ae949bfec6a57131caacae14a36e8c1465080" | ||
"gitHead": "5d0cd5a1a7d80ae3da90f2331d25161b28f06910" | ||
} |
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
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30083
28
287
0
1
80