@strapi/logger 5.9.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +114 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,121 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
7
|
if (e) {
|
|
8
|
-
|
|
9
|
-
if (k !==
|
|
10
|
-
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
11
|
Object.defineProperty(n, k, d.get ? d : {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: ()
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
});
|
|
17
17
|
}
|
|
18
18
|
n.default = e;
|
|
19
19
|
return Object.freeze(n);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
var winston__namespace = /*#__PURE__*/_interopNamespaceDefault(winston);
|
|
23
|
+
|
|
22
24
|
const LEVELS = winston.config.npm.levels;
|
|
23
|
-
const LEVEL_LABEL =
|
|
25
|
+
const LEVEL_LABEL = 'silly';
|
|
24
26
|
LEVELS[LEVEL_LABEL];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
|
|
28
|
+
const logErrors = winston.format((info)=>{
|
|
29
|
+
if (info instanceof Error) {
|
|
30
|
+
return {
|
|
31
|
+
...info,
|
|
32
|
+
message: `${info.message}${info.stack ? `\n${info.stack}` : ''}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return info;
|
|
31
36
|
});
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
const levelFilter = (...levels) => {
|
|
55
|
-
return winston.format((info) => levels.some((level) => info.level.includes(level)) ? info : false)();
|
|
56
|
-
};
|
|
57
|
-
const excludeColors = winston.format.printf(({ message }) => {
|
|
58
|
-
if (typeof message !== "string") {
|
|
59
|
-
return message;
|
|
60
|
-
}
|
|
61
|
-
return message.replace(
|
|
62
|
-
// eslint-disable-next-line no-control-regex
|
|
63
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
|
64
|
-
""
|
|
65
|
-
);
|
|
37
|
+
|
|
38
|
+
const defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
|
|
39
|
+
/**
|
|
40
|
+
* Create a pretty print formatter for a winston logger
|
|
41
|
+
* @param options
|
|
42
|
+
*/ var prettyPrint = ((options = {})=>{
|
|
43
|
+
const { timestamps = true, colors = true } = options;
|
|
44
|
+
const handlers = [];
|
|
45
|
+
if (timestamps) {
|
|
46
|
+
handlers.push(winston.format.timestamp({
|
|
47
|
+
format: timestamps === true ? defaultTimestampFormat : timestamps
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
if (colors) {
|
|
51
|
+
handlers.push(winston.format.colorize());
|
|
52
|
+
}
|
|
53
|
+
handlers.push(logErrors());
|
|
54
|
+
handlers.push(winston.format.printf(({ level, message, timestamp })=>{
|
|
55
|
+
return `${timestamps ? `[${timestamp}] ` : ''}${level}: ${message}`;
|
|
56
|
+
}));
|
|
57
|
+
return winston.format.combine(...handlers);
|
|
66
58
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
const newMessage = `[${timestamp}] ${level}: ${message}`;
|
|
72
|
-
return newMessage.replace(
|
|
73
|
-
// eslint-disable-next-line no-control-regex
|
|
74
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
|
75
|
-
""
|
|
76
|
-
);
|
|
59
|
+
|
|
60
|
+
var levelFilter = ((...levels)=>{
|
|
61
|
+
return winston.format((info)=>levels.some((level)=>info.level.includes(level)) ? info : false)();
|
|
77
62
|
});
|
|
78
|
-
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* This will remove the chalk color codes from the message provided.
|
|
66
|
+
* It's used to log plain text in the log file
|
|
67
|
+
*/ var excludeColors = winston.format.printf(({ message })=>{
|
|
68
|
+
if (typeof message !== 'string') {
|
|
69
|
+
return message;
|
|
70
|
+
}
|
|
71
|
+
return message.replace(// eslint-disable-next-line no-control-regex
|
|
72
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* This will remove the chalk color codes from the message provided.
|
|
77
|
+
* It's used to log plain text in the log file
|
|
78
|
+
*/ var detailedLog = winston.format.printf(({ message, level, timestamp })=>{
|
|
79
|
+
if (typeof message !== 'string') {
|
|
80
|
+
return message;
|
|
81
|
+
}
|
|
82
|
+
const newMessage = `[${timestamp}] ${level}: ${message}`;
|
|
83
|
+
return newMessage.replace(// eslint-disable-next-line no-control-regex
|
|
84
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
79
88
|
__proto__: null,
|
|
80
89
|
detailedLogs: detailedLog,
|
|
81
|
-
excludeColors,
|
|
82
|
-
levelFilter,
|
|
83
|
-
prettyPrint
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
excludeColors: excludeColors,
|
|
91
|
+
levelFilter: levelFilter,
|
|
92
|
+
prettyPrint: prettyPrint
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var defaultConfiguration = (()=>{
|
|
96
|
+
return {
|
|
97
|
+
level: LEVEL_LABEL,
|
|
98
|
+
levels: LEVELS,
|
|
99
|
+
format: prettyPrint(),
|
|
100
|
+
transports: [
|
|
101
|
+
new winston.transports.Console()
|
|
102
|
+
]
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
var outputFileConfiguration = ((filename, fileTransportOptions = {})=>{
|
|
107
|
+
return {
|
|
108
|
+
level: LEVEL_LABEL,
|
|
109
|
+
levels: LEVELS,
|
|
110
|
+
format: prettyPrint(),
|
|
111
|
+
transports: [
|
|
112
|
+
new winston.transports.Console(),
|
|
113
|
+
new winston.transports.File({
|
|
114
|
+
level: 'error',
|
|
115
|
+
filename,
|
|
116
|
+
format: excludeColors,
|
|
117
|
+
...fileTransportOptions
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
110
124
|
__proto__: null,
|
|
111
125
|
createDefaultConfiguration: defaultConfiguration,
|
|
112
126
|
createOutputFileConfiguration: outputFileConfiguration
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const createLogger = (userConfiguration = {})=>{
|
|
130
|
+
const configuration = defaultConfiguration();
|
|
131
|
+
Object.assign(configuration, userConfiguration);
|
|
132
|
+
return winston__namespace.createLogger(configuration);
|
|
118
133
|
};
|
|
134
|
+
|
|
119
135
|
exports.winston = winston__namespace;
|
|
120
136
|
exports.configs = index;
|
|
121
137
|
exports.createLogger = createLogger;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/constants.ts","../src/formats/log-errors.ts","../src/formats/pretty-print.ts","../src/formats/level-filter.ts","../src/formats/exclude-colors.ts","../src/formats/detailed-log.ts","../src/configs/default-configuration.ts","../src/configs/output-file-configuration.ts","../src/index.ts"],"sourcesContent":["import { config } from 'winston';\n\nconst LEVELS = config.npm.levels;\nconst LEVEL_LABEL = 'silly';\nconst LEVEL = LEVELS[LEVEL_LABEL];\n\nexport { LEVEL, LEVEL_LABEL, LEVELS };\n","import { format, Logform } from 'winston';\n\nconst logErrors: Logform.FormatWrap = format((info) => {\n if (info instanceof Error) {\n return { ...info, message: `${info.message as string}${info.stack ? `\\n${info.stack}` : ''}` };\n }\n\n return info;\n});\n\nexport default logErrors;\n","import { format, Logform } from 'winston';\nimport logErrors from './log-errors';\n\nconst defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport interface PrettyPrintOptions {\n /**\n * Enable or disable timestamps print if it's a boolean value. Use the given format for the timestamps if it's a string\n */\n timestamps?: Logform.TimestampOptions['format'] | boolean;\n /**\n * Enable or disable the use of colors for the log level\n */\n colors?: boolean;\n}\n\n/**\n * Create a pretty print formatter for a winston logger\n * @param options\n */\nexport default (options: PrettyPrintOptions = {}): Logform.Format => {\n const { timestamps = true, colors = true } = options;\n\n const handlers: Logform.Format[] = [];\n\n if (timestamps) {\n handlers.push(\n format.timestamp({\n format: timestamps === true ? defaultTimestampFormat : timestamps,\n })\n );\n }\n\n if (colors) {\n handlers.push(format.colorize());\n }\n\n handlers.push(logErrors());\n\n handlers.push(\n format.printf(({ level, message, timestamp }) => {\n return `${timestamps ? `[${timestamp as string}] ` : ''}${level}: ${message as string}`;\n })\n );\n\n return format.combine(...handlers);\n};\n","import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n return message.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message, level, timestamp }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n const newMessage = `[${timestamp as string}] ${level}: ${message as string}`;\n\n return newMessage.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { transports, LoggerOptions } from 'winston';\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint } from '../formats';\n\nexport default (): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [new transports.Console()],\n };\n};\n","import { transports, LoggerOptions } from 'winston';\n\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint, excludeColors } from '../formats';\n\nexport default (\n filename: string,\n fileTransportOptions: transports.FileTransportOptions = {}\n): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({\n level: 'error',\n filename,\n format: excludeColors,\n ...fileTransportOptions,\n }),\n ],\n };\n};\n","import * as winston from 'winston';\nimport * as configs from './configs';\n\nexport * as formats from './formats';\n\nexport type Logger = winston.Logger;\n\nconst createLogger = (userConfiguration: winston.LoggerOptions = {}): winston.Logger => {\n const configuration = configs.createDefaultConfiguration();\n\n Object.assign(configuration, userConfiguration);\n\n return winston.createLogger(configuration);\n};\n\nexport { createLogger, winston, configs };\n"],"names":["config","format","transports","configs
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/constants.ts","../src/formats/log-errors.ts","../src/formats/pretty-print.ts","../src/formats/level-filter.ts","../src/formats/exclude-colors.ts","../src/formats/detailed-log.ts","../src/configs/default-configuration.ts","../src/configs/output-file-configuration.ts","../src/index.ts"],"sourcesContent":["import { config } from 'winston';\n\nconst LEVELS = config.npm.levels;\nconst LEVEL_LABEL = 'silly';\nconst LEVEL = LEVELS[LEVEL_LABEL];\n\nexport { LEVEL, LEVEL_LABEL, LEVELS };\n","import { format, Logform } from 'winston';\n\nconst logErrors: Logform.FormatWrap = format((info) => {\n if (info instanceof Error) {\n return { ...info, message: `${info.message as string}${info.stack ? `\\n${info.stack}` : ''}` };\n }\n\n return info;\n});\n\nexport default logErrors;\n","import { format, Logform } from 'winston';\nimport logErrors from './log-errors';\n\nconst defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport interface PrettyPrintOptions {\n /**\n * Enable or disable timestamps print if it's a boolean value. Use the given format for the timestamps if it's a string\n */\n timestamps?: Logform.TimestampOptions['format'] | boolean;\n /**\n * Enable or disable the use of colors for the log level\n */\n colors?: boolean;\n}\n\n/**\n * Create a pretty print formatter for a winston logger\n * @param options\n */\nexport default (options: PrettyPrintOptions = {}): Logform.Format => {\n const { timestamps = true, colors = true } = options;\n\n const handlers: Logform.Format[] = [];\n\n if (timestamps) {\n handlers.push(\n format.timestamp({\n format: timestamps === true ? defaultTimestampFormat : timestamps,\n })\n );\n }\n\n if (colors) {\n handlers.push(format.colorize());\n }\n\n handlers.push(logErrors());\n\n handlers.push(\n format.printf(({ level, message, timestamp }) => {\n return `${timestamps ? `[${timestamp as string}] ` : ''}${level}: ${message as string}`;\n })\n );\n\n return format.combine(...handlers);\n};\n","import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n return message.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message, level, timestamp }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n const newMessage = `[${timestamp as string}] ${level}: ${message as string}`;\n\n return newMessage.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { transports, LoggerOptions } from 'winston';\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint } from '../formats';\n\nexport default (): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [new transports.Console()],\n };\n};\n","import { transports, LoggerOptions } from 'winston';\n\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint, excludeColors } from '../formats';\n\nexport default (\n filename: string,\n fileTransportOptions: transports.FileTransportOptions = {}\n): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({\n level: 'error',\n filename,\n format: excludeColors,\n ...fileTransportOptions,\n }),\n ],\n };\n};\n","import * as winston from 'winston';\nimport * as configs from './configs';\n\nexport * as formats from './formats';\n\nexport type Logger = winston.Logger;\n\nconst createLogger = (userConfiguration: winston.LoggerOptions = {}): winston.Logger => {\n const configuration = configs.createDefaultConfiguration();\n\n Object.assign(configuration, userConfiguration);\n\n return winston.createLogger(configuration);\n};\n\nexport { createLogger, winston, configs };\n"],"names":["LEVELS","config","npm","levels","LEVEL_LABEL","logErrors","format","info","Error","message","stack","defaultTimestampFormat","options","timestamps","colors","handlers","push","timestamp","colorize","printf","level","combine","some","includes","replace","newMessage","prettyPrint","transports","Console","filename","fileTransportOptions","File","excludeColors","createLogger","userConfiguration","configuration","configs","Object","assign","winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAMA,MAASC,GAAAA,cAAAA,CAAOC,GAAG,CAACC,MAAM;AAChC,MAAMC,WAAc,GAAA,OAAA;AACNJ,MAAM,CAACI,WAAY;;ACFjC,MAAMC,SAAAA,GAAgCC,eAAO,CAACC,IAAAA,GAAAA;AAC5C,IAAA,IAAIA,gBAAgBC,KAAO,EAAA;QACzB,OAAO;AAAE,YAAA,GAAGD,IAAI;AAAEE,YAAAA,OAAAA,EAAS,CAAC,EAAEF,IAAAA,CAAKE,OAAO,CAAW,EAAEF,KAAKG,KAAK,GAAG,CAAC,EAAE,EAAEH,IAAKG,CAAAA,KAAK,CAAC,CAAC,GAAG,GAAG;AAAE,SAAA;AAC/F;IAEA,OAAOH,IAAAA;AACT,CAAA,CAAA;;ACLA,MAAMI,sBAAyB,GAAA,yBAAA;AAa/B;;;AAGC,IACD,kBAAe,CAAA,CAACC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AAA;IAExDC,MAAOC,CAAAA,MAAM,CAACH,aAAeD,EAAAA,iBAAAA,CAAAA;IAE7B,OAAOK,kBAAAA,CAAQN,YAAY,CAACE,aAAAA,CAAAA;AAC9B;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,106 +1,117 @@
|
|
|
1
|
-
import * as winston from
|
|
2
|
-
import { config, format, transports } from
|
|
1
|
+
import * as winston from 'winston';
|
|
2
|
+
import { config, format, transports } from 'winston';
|
|
3
|
+
export { winston };
|
|
4
|
+
|
|
3
5
|
const LEVELS = config.npm.levels;
|
|
4
|
-
const LEVEL_LABEL =
|
|
6
|
+
const LEVEL_LABEL = 'silly';
|
|
5
7
|
LEVELS[LEVEL_LABEL];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
|
|
9
|
+
const logErrors = format((info)=>{
|
|
10
|
+
if (info instanceof Error) {
|
|
11
|
+
return {
|
|
12
|
+
...info,
|
|
13
|
+
message: `${info.message}${info.stack ? `\n${info.stack}` : ''}`
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return info;
|
|
12
17
|
});
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const excludeColors = format.printf(({ message }) => {
|
|
39
|
-
if (typeof message !== "string") {
|
|
40
|
-
return message;
|
|
41
|
-
}
|
|
42
|
-
return message.replace(
|
|
43
|
-
// eslint-disable-next-line no-control-regex
|
|
44
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
|
45
|
-
""
|
|
46
|
-
);
|
|
18
|
+
|
|
19
|
+
const defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
|
|
20
|
+
/**
|
|
21
|
+
* Create a pretty print formatter for a winston logger
|
|
22
|
+
* @param options
|
|
23
|
+
*/ var prettyPrint = ((options = {})=>{
|
|
24
|
+
const { timestamps = true, colors = true } = options;
|
|
25
|
+
const handlers = [];
|
|
26
|
+
if (timestamps) {
|
|
27
|
+
handlers.push(format.timestamp({
|
|
28
|
+
format: timestamps === true ? defaultTimestampFormat : timestamps
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
if (colors) {
|
|
32
|
+
handlers.push(format.colorize());
|
|
33
|
+
}
|
|
34
|
+
handlers.push(logErrors());
|
|
35
|
+
handlers.push(format.printf(({ level, message, timestamp })=>{
|
|
36
|
+
return `${timestamps ? `[${timestamp}] ` : ''}${level}: ${message}`;
|
|
37
|
+
}));
|
|
38
|
+
return format.combine(...handlers);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var levelFilter = ((...levels)=>{
|
|
42
|
+
return format((info)=>levels.some((level)=>info.level.includes(level)) ? info : false)();
|
|
47
43
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* This will remove the chalk color codes from the message provided.
|
|
47
|
+
* It's used to log plain text in the log file
|
|
48
|
+
*/ var excludeColors = format.printf(({ message })=>{
|
|
49
|
+
if (typeof message !== 'string') {
|
|
50
|
+
return message;
|
|
51
|
+
}
|
|
52
|
+
return message.replace(// eslint-disable-next-line no-control-regex
|
|
53
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
58
54
|
});
|
|
59
|
-
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* This will remove the chalk color codes from the message provided.
|
|
58
|
+
* It's used to log plain text in the log file
|
|
59
|
+
*/ var detailedLog = format.printf(({ message, level, timestamp })=>{
|
|
60
|
+
if (typeof message !== 'string') {
|
|
61
|
+
return message;
|
|
62
|
+
}
|
|
63
|
+
const newMessage = `[${timestamp}] ${level}: ${message}`;
|
|
64
|
+
return newMessage.replace(// eslint-disable-next-line no-control-regex
|
|
65
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
60
69
|
__proto__: null,
|
|
61
70
|
detailedLogs: detailedLog,
|
|
62
|
-
excludeColors,
|
|
63
|
-
levelFilter,
|
|
64
|
-
prettyPrint
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
excludeColors: excludeColors,
|
|
72
|
+
levelFilter: levelFilter,
|
|
73
|
+
prettyPrint: prettyPrint
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var defaultConfiguration = (()=>{
|
|
77
|
+
return {
|
|
78
|
+
level: LEVEL_LABEL,
|
|
79
|
+
levels: LEVELS,
|
|
80
|
+
format: prettyPrint(),
|
|
81
|
+
transports: [
|
|
82
|
+
new transports.Console()
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var outputFileConfiguration = ((filename, fileTransportOptions = {})=>{
|
|
88
|
+
return {
|
|
89
|
+
level: LEVEL_LABEL,
|
|
90
|
+
levels: LEVELS,
|
|
91
|
+
format: prettyPrint(),
|
|
92
|
+
transports: [
|
|
93
|
+
new transports.Console(),
|
|
94
|
+
new transports.File({
|
|
95
|
+
level: 'error',
|
|
96
|
+
filename,
|
|
97
|
+
format: excludeColors,
|
|
98
|
+
...fileTransportOptions
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
91
105
|
__proto__: null,
|
|
92
106
|
createDefaultConfiguration: defaultConfiguration,
|
|
93
107
|
createOutputFileConfiguration: outputFileConfiguration
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
index as configs,
|
|
102
|
-
createLogger,
|
|
103
|
-
index$1 as formats,
|
|
104
|
-
winston
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const createLogger = (userConfiguration = {})=>{
|
|
111
|
+
const configuration = defaultConfiguration();
|
|
112
|
+
Object.assign(configuration, userConfiguration);
|
|
113
|
+
return winston.createLogger(configuration);
|
|
105
114
|
};
|
|
115
|
+
|
|
116
|
+
export { index as configs, createLogger, index$1 as formats };
|
|
106
117
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/constants.ts","../src/formats/log-errors.ts","../src/formats/pretty-print.ts","../src/formats/level-filter.ts","../src/formats/exclude-colors.ts","../src/formats/detailed-log.ts","../src/configs/default-configuration.ts","../src/configs/output-file-configuration.ts","../src/index.ts"],"sourcesContent":["import { config } from 'winston';\n\nconst LEVELS = config.npm.levels;\nconst LEVEL_LABEL = 'silly';\nconst LEVEL = LEVELS[LEVEL_LABEL];\n\nexport { LEVEL, LEVEL_LABEL, LEVELS };\n","import { format, Logform } from 'winston';\n\nconst logErrors: Logform.FormatWrap = format((info) => {\n if (info instanceof Error) {\n return { ...info, message: `${info.message as string}${info.stack ? `\\n${info.stack}` : ''}` };\n }\n\n return info;\n});\n\nexport default logErrors;\n","import { format, Logform } from 'winston';\nimport logErrors from './log-errors';\n\nconst defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport interface PrettyPrintOptions {\n /**\n * Enable or disable timestamps print if it's a boolean value. Use the given format for the timestamps if it's a string\n */\n timestamps?: Logform.TimestampOptions['format'] | boolean;\n /**\n * Enable or disable the use of colors for the log level\n */\n colors?: boolean;\n}\n\n/**\n * Create a pretty print formatter for a winston logger\n * @param options\n */\nexport default (options: PrettyPrintOptions = {}): Logform.Format => {\n const { timestamps = true, colors = true } = options;\n\n const handlers: Logform.Format[] = [];\n\n if (timestamps) {\n handlers.push(\n format.timestamp({\n format: timestamps === true ? defaultTimestampFormat : timestamps,\n })\n );\n }\n\n if (colors) {\n handlers.push(format.colorize());\n }\n\n handlers.push(logErrors());\n\n handlers.push(\n format.printf(({ level, message, timestamp }) => {\n return `${timestamps ? `[${timestamp as string}] ` : ''}${level}: ${message as string}`;\n })\n );\n\n return format.combine(...handlers);\n};\n","import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n return message.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message, level, timestamp }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n const newMessage = `[${timestamp as string}] ${level}: ${message as string}`;\n\n return newMessage.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { transports, LoggerOptions } from 'winston';\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint } from '../formats';\n\nexport default (): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [new transports.Console()],\n };\n};\n","import { transports, LoggerOptions } from 'winston';\n\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint, excludeColors } from '../formats';\n\nexport default (\n filename: string,\n fileTransportOptions: transports.FileTransportOptions = {}\n): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({\n level: 'error',\n filename,\n format: excludeColors,\n ...fileTransportOptions,\n }),\n ],\n };\n};\n","import * as winston from 'winston';\nimport * as configs from './configs';\n\nexport * as formats from './formats';\n\nexport type Logger = winston.Logger;\n\nconst createLogger = (userConfiguration: winston.LoggerOptions = {}): winston.Logger => {\n const configuration = configs.createDefaultConfiguration();\n\n Object.assign(configuration, userConfiguration);\n\n return winston.createLogger(configuration);\n};\n\nexport { createLogger, winston, configs };\n"],"names":["configs
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/constants.ts","../src/formats/log-errors.ts","../src/formats/pretty-print.ts","../src/formats/level-filter.ts","../src/formats/exclude-colors.ts","../src/formats/detailed-log.ts","../src/configs/default-configuration.ts","../src/configs/output-file-configuration.ts","../src/index.ts"],"sourcesContent":["import { config } from 'winston';\n\nconst LEVELS = config.npm.levels;\nconst LEVEL_LABEL = 'silly';\nconst LEVEL = LEVELS[LEVEL_LABEL];\n\nexport { LEVEL, LEVEL_LABEL, LEVELS };\n","import { format, Logform } from 'winston';\n\nconst logErrors: Logform.FormatWrap = format((info) => {\n if (info instanceof Error) {\n return { ...info, message: `${info.message as string}${info.stack ? `\\n${info.stack}` : ''}` };\n }\n\n return info;\n});\n\nexport default logErrors;\n","import { format, Logform } from 'winston';\nimport logErrors from './log-errors';\n\nconst defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport interface PrettyPrintOptions {\n /**\n * Enable or disable timestamps print if it's a boolean value. Use the given format for the timestamps if it's a string\n */\n timestamps?: Logform.TimestampOptions['format'] | boolean;\n /**\n * Enable or disable the use of colors for the log level\n */\n colors?: boolean;\n}\n\n/**\n * Create a pretty print formatter for a winston logger\n * @param options\n */\nexport default (options: PrettyPrintOptions = {}): Logform.Format => {\n const { timestamps = true, colors = true } = options;\n\n const handlers: Logform.Format[] = [];\n\n if (timestamps) {\n handlers.push(\n format.timestamp({\n format: timestamps === true ? defaultTimestampFormat : timestamps,\n })\n );\n }\n\n if (colors) {\n handlers.push(format.colorize());\n }\n\n handlers.push(logErrors());\n\n handlers.push(\n format.printf(({ level, message, timestamp }) => {\n return `${timestamps ? `[${timestamp as string}] ` : ''}${level}: ${message as string}`;\n })\n );\n\n return format.combine(...handlers);\n};\n","import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n return message.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { format } from 'winston';\n\n/**\n * This will remove the chalk color codes from the message provided.\n * It's used to log plain text in the log file\n */\nexport default format.printf(({ message, level, timestamp }) => {\n if (typeof message !== 'string') {\n return message;\n }\n\n const newMessage = `[${timestamp as string}] ${level}: ${message as string}`;\n\n return newMessage.replace(\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n ''\n );\n});\n","import { transports, LoggerOptions } from 'winston';\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint } from '../formats';\n\nexport default (): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [new transports.Console()],\n };\n};\n","import { transports, LoggerOptions } from 'winston';\n\nimport { LEVEL_LABEL, LEVELS } from '../constants';\nimport { prettyPrint, excludeColors } from '../formats';\n\nexport default (\n filename: string,\n fileTransportOptions: transports.FileTransportOptions = {}\n): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({\n level: 'error',\n filename,\n format: excludeColors,\n ...fileTransportOptions,\n }),\n ],\n };\n};\n","import * as winston from 'winston';\nimport * as configs from './configs';\n\nexport * as formats from './formats';\n\nexport type Logger = winston.Logger;\n\nconst createLogger = (userConfiguration: winston.LoggerOptions = {}): winston.Logger => {\n const configuration = configs.createDefaultConfiguration();\n\n Object.assign(configuration, userConfiguration);\n\n return winston.createLogger(configuration);\n};\n\nexport { createLogger, winston, configs };\n"],"names":["LEVELS","config","npm","levels","LEVEL_LABEL","logErrors","format","info","Error","message","stack","defaultTimestampFormat","options","timestamps","colors","handlers","push","timestamp","colorize","printf","level","combine","some","includes","replace","newMessage","prettyPrint","transports","Console","filename","fileTransportOptions","File","excludeColors","createLogger","userConfiguration","configuration","configs","Object","assign","winston"],"mappings":";;;;AAEA,MAAMA,MAASC,GAAAA,MAAAA,CAAOC,GAAG,CAACC,MAAM;AAChC,MAAMC,WAAc,GAAA,OAAA;AACNJ,MAAM,CAACI,WAAY;;ACFjC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,EAAAA,WAAAA;QACPD,MAAQH,EAAAA,MAAAA;QACRM,MAAQoB,EAAAA,WAAAA,EAAAA;QACRC,UAAY,EAAA;AACV,YAAA,IAAIA,WAAWC,OAAO,EAAA;YACtB,IAAID,UAAAA,CAAWI,IAAI,CAAC;gBAClBX,KAAO,EAAA,OAAA;AACPS,gBAAAA,QAAAA;gBACAvB,MAAQ0B,EAAAA,aAAAA;AACR,gBAAA,GAAGF;AACL,aAAA;AACD;AACH,KAAA;AACF,CAAA;;;;;;;;AChBA,MAAMG,YAAe,GAAA,CAACC,iBAA2C,GAAA,EAAE,GAAA;IACjE,MAAMC,aAAAA,GAAgBC,oBAAkC,EAAA;IAExDC,MAAOC,CAAAA,MAAM,CAACH,aAAeD,EAAAA,iBAAAA,CAAAA;IAE7B,OAAOK,OAAAA,CAAQN,YAAY,CAACE,aAAAA,CAAAA;AAC9B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/logger",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"description": "Strapi's logger",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -31,20 +31,21 @@
|
|
|
31
31
|
"dist/"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "
|
|
34
|
+
"build": "run -T npm-run-all clean --parallel build:code build:types",
|
|
35
|
+
"build:code": "run -T rollup -c",
|
|
36
|
+
"build:types": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
35
37
|
"clean": "run -T rimraf ./dist",
|
|
36
38
|
"lint": "run -T eslint .",
|
|
37
39
|
"test:ts": "run -T tsc --noEmit",
|
|
38
|
-
"watch": "
|
|
40
|
+
"watch": "run -T rollup -c -w"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"lodash": "4.17.21",
|
|
42
44
|
"winston": "3.10.0"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"tsconfig": "5.9.0"
|
|
47
|
+
"eslint-config-custom": "5.10.0",
|
|
48
|
+
"tsconfig": "5.10.0"
|
|
48
49
|
},
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=18.0.0 <=22.x.x",
|