@strapi/logger 0.0.0-next.f7babb775ed9a7e18d8351cb7f74c63e016323c4 → 0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d
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/LICENSE +18 -3
- package/dist/configs/default-configuration.d.ts +1 -0
- package/dist/configs/default-configuration.d.ts.map +1 -0
- package/dist/configs/default-configuration.js +19 -12
- package/dist/configs/default-configuration.js.map +1 -1
- package/dist/configs/default-configuration.mjs +19 -0
- package/dist/configs/default-configuration.mjs.map +1 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/configs/index.d.ts.map +1 -0
- package/dist/configs/index.js +10 -11
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/index.mjs +3 -0
- package/dist/configs/index.mjs.map +1 -0
- package/dist/configs/output-file-configuration.d.ts +3 -2
- package/dist/configs/output-file-configuration.d.ts.map +1 -0
- package/dist/configs/output-file-configuration.js +24 -14
- package/dist/configs/output-file-configuration.js.map +1 -1
- package/dist/configs/output-file-configuration.mjs +25 -0
- package/dist/configs/output-file-configuration.mjs.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -9
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +8 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/formats/detailed-log.d.ts +7 -0
- package/dist/formats/detailed-log.d.ts.map +1 -0
- package/dist/formats/detailed-log.js +18 -0
- package/dist/formats/detailed-log.js.map +1 -0
- package/dist/formats/detailed-log.mjs +16 -0
- package/dist/formats/detailed-log.mjs.map +1 -0
- package/dist/formats/exclude-colors.d.ts +1 -0
- package/dist/formats/exclude-colors.d.ts.map +1 -0
- package/dist/formats/exclude-colors.js +9 -8
- package/dist/formats/exclude-colors.js.map +1 -1
- package/dist/formats/exclude-colors.mjs +15 -0
- package/dist/formats/exclude-colors.mjs.map +1 -0
- package/dist/formats/index.d.ts +4 -1
- package/dist/formats/index.d.ts.map +1 -0
- package/dist/formats/index.js +14 -13
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/index.mjs +5 -0
- package/dist/formats/index.mjs.map +1 -0
- package/dist/formats/level-filter.d.ts +1 -0
- package/dist/formats/level-filter.d.ts.map +1 -0
- package/dist/formats/level-filter.js +10 -7
- package/dist/formats/level-filter.js.map +1 -1
- package/dist/formats/level-filter.mjs +8 -0
- package/dist/formats/level-filter.mjs.map +1 -0
- package/dist/formats/log-errors.d.ts +1 -0
- package/dist/formats/log-errors.d.ts.map +1 -0
- package/dist/formats/log-errors.js +12 -7
- package/dist/formats/log-errors.js.map +1 -1
- package/dist/formats/log-errors.mjs +14 -0
- package/dist/formats/log-errors.mjs.map +1 -0
- package/dist/formats/pretty-print.d.ts +1 -0
- package/dist/formats/pretty-print.d.ts.map +1 -0
- package/dist/formats/pretty-print.js +16 -17
- package/dist/formats/pretty-print.js.map +1 -1
- package/dist/formats/pretty-print.mjs +27 -0
- package/dist/formats/pretty-print.mjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +15 -13
package/LICENSE
CHANGED
|
@@ -2,7 +2,21 @@ Copyright (c) 2015-present Strapi Solutions SAS
|
|
|
2
2
|
|
|
3
3
|
Portions of the Strapi software are licensed as follows:
|
|
4
4
|
|
|
5
|
-
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined
|
|
5
|
+
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined below.
|
|
6
|
+
|
|
7
|
+
Enterprise License
|
|
8
|
+
|
|
9
|
+
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
|
|
10
|
+
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
|
|
11
|
+
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
|
|
12
|
+
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
|
|
13
|
+
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
|
|
14
|
+
|
|
15
|
+
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
|
|
16
|
+
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
|
|
17
|
+
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
|
|
18
|
+
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
|
|
19
|
+
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
|
|
6
20
|
|
|
7
21
|
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
|
|
8
22
|
|
|
@@ -18,5 +32,6 @@ furnished to do so, subject to the following conditions:
|
|
|
18
32
|
The above copyright notice and this permission notice shall be included in all
|
|
19
33
|
copies or substantial portions of the Software.
|
|
20
34
|
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
37
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-configuration.d.ts","sourceRoot":"","sources":["../../src/configs/default-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,SAAS,CAAC;8BAIjC,aAAa;AAAhC,wBAOE"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
var constants = require('../constants.js');
|
|
5
|
+
var prettyPrint = require('../formats/pretty-print.js');
|
|
6
|
+
require('../formats/exclude-colors.js');
|
|
7
|
+
require('../formats/detailed-log.js');
|
|
8
|
+
|
|
9
|
+
var defaultConfiguration = (()=>{
|
|
7
10
|
return {
|
|
8
|
-
level:
|
|
9
|
-
levels:
|
|
10
|
-
format:
|
|
11
|
-
transports: [
|
|
11
|
+
level: constants.LEVEL_LABEL,
|
|
12
|
+
levels: constants.LEVELS,
|
|
13
|
+
format: prettyPrint(),
|
|
14
|
+
transports: [
|
|
15
|
+
new winston.transports.Console()
|
|
16
|
+
]
|
|
12
17
|
};
|
|
13
|
-
};
|
|
14
|
-
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
module.exports = defaultConfiguration;
|
|
21
|
+
//# sourceMappingURL=default-configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-configuration.js","
|
|
1
|
+
{"version":3,"file":"default-configuration.js","sources":["../../src/configs/default-configuration.ts"],"sourcesContent":["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"],"names":["level","LEVEL_LABEL","levels","LEVELS","format","prettyPrint","transports","Console"],"mappings":";;;;;;;;AAIA,2BAAe,CAAA,IAAA;IACb,OAAO;QACLA,KAAOC,EAAAA,qBAAAA;QACPC,MAAQC,EAAAA,gBAAAA;QACRC,MAAQC,EAAAA,WAAAA,EAAAA;QACRC,UAAY,EAAA;AAAC,YAAA,IAAIA,mBAAWC,OAAO;AAAG;AACxC,KAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { transports } from 'winston';
|
|
2
|
+
import { LEVEL_LABEL, LEVELS } from '../constants.mjs';
|
|
3
|
+
import prettyPrint from '../formats/pretty-print.mjs';
|
|
4
|
+
import '../formats/exclude-colors.mjs';
|
|
5
|
+
import '../formats/detailed-log.mjs';
|
|
6
|
+
|
|
7
|
+
var defaultConfiguration = (()=>{
|
|
8
|
+
return {
|
|
9
|
+
level: LEVEL_LABEL,
|
|
10
|
+
levels: LEVELS,
|
|
11
|
+
format: prettyPrint(),
|
|
12
|
+
transports: [
|
|
13
|
+
new transports.Console()
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { defaultConfiguration as default };
|
|
19
|
+
//# sourceMappingURL=default-configuration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-configuration.mjs","sources":["../../src/configs/default-configuration.ts"],"sourcesContent":["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"],"names":["level","LEVEL_LABEL","levels","LEVELS","format","prettyPrint","transports","Console"],"mappings":";;;;;;AAIA,2BAAe,CAAA,IAAA;IACb,OAAO;QACLA,KAAOC,EAAAA,WAAAA;QACPC,MAAQC,EAAAA,MAAAA;QACRC,MAAQC,EAAAA,WAAAA,EAAAA;QACRC,UAAY,EAAA;AAAC,YAAA,IAAIA,WAAWC,OAAO;AAAG;AACxC,KAAA;AACF,CAAA;;;;"}
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/configs/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultConfiguration = require('./default-configuration.js');
|
|
4
|
+
var outputFileConfiguration = require('./output-file-configuration.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.createDefaultConfiguration = defaultConfiguration;
|
|
9
|
+
exports.createOutputFileConfiguration = outputFileConfiguration;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { LoggerOptions } from 'winston';
|
|
2
|
-
declare const _default: (filename: string) => LoggerOptions;
|
|
1
|
+
import { transports, LoggerOptions } from 'winston';
|
|
2
|
+
declare const _default: (filename: string, fileTransportOptions?: transports.FileTransportOptions) => LoggerOptions;
|
|
3
3
|
export default _default;
|
|
4
|
+
//# sourceMappingURL=output-file-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-file-configuration.d.ts","sourceRoot":"","sources":["../../src/configs/output-file-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;mCAMxC,MAAM,yBACM,WAAW,oBAAoB,KACpD,aAAa;AAHhB,wBAkBE"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
var constants = require('../constants.js');
|
|
5
|
+
var prettyPrint = require('../formats/pretty-print.js');
|
|
6
|
+
var excludeColors = require('../formats/exclude-colors.js');
|
|
7
|
+
require('../formats/detailed-log.js');
|
|
8
|
+
|
|
9
|
+
var outputFileConfiguration = ((filename, fileTransportOptions = {})=>{
|
|
7
10
|
return {
|
|
8
|
-
level:
|
|
9
|
-
levels:
|
|
10
|
-
format:
|
|
11
|
+
level: constants.LEVEL_LABEL,
|
|
12
|
+
levels: constants.LEVELS,
|
|
13
|
+
format: prettyPrint(),
|
|
11
14
|
transports: [
|
|
12
|
-
new
|
|
13
|
-
new
|
|
14
|
-
|
|
15
|
+
new winston.transports.Console(),
|
|
16
|
+
new winston.transports.File({
|
|
17
|
+
level: 'error',
|
|
18
|
+
filename,
|
|
19
|
+
format: excludeColors,
|
|
20
|
+
...fileTransportOptions
|
|
21
|
+
})
|
|
22
|
+
]
|
|
15
23
|
};
|
|
16
|
-
};
|
|
17
|
-
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
module.exports = outputFileConfiguration;
|
|
27
|
+
//# sourceMappingURL=output-file-configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-file-configuration.js","
|
|
1
|
+
{"version":3,"file":"output-file-configuration.js","sources":["../../src/configs/output-file-configuration.ts"],"sourcesContent":["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"],"names":["filename","fileTransportOptions","level","LEVEL_LABEL","levels","LEVELS","format","prettyPrint","transports","Console","File","excludeColors"],"mappings":";;;;;;;;AAKA,8BAAe,CAAA,CACbA,QACAC,EAAAA,oBAAAA,GAAwD,EAAE,GAAA;IAE1D,OAAO;QACLC,KAAOC,EAAAA,qBAAAA;QACPC,MAAQC,EAAAA,gBAAAA;QACRC,MAAQC,EAAAA,WAAAA,EAAAA;QACRC,UAAY,EAAA;AACV,YAAA,IAAIA,mBAAWC,OAAO,EAAA;YACtB,IAAID,kBAAAA,CAAWE,IAAI,CAAC;gBAClBR,KAAO,EAAA,OAAA;AACPF,gBAAAA,QAAAA;gBACAM,MAAQK,EAAAA,aAAAA;AACR,gBAAA,GAAGV;AACL,aAAA;AACD;AACH,KAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { transports } from 'winston';
|
|
2
|
+
import { LEVEL_LABEL, LEVELS } from '../constants.mjs';
|
|
3
|
+
import prettyPrint from '../formats/pretty-print.mjs';
|
|
4
|
+
import excludeColors from '../formats/exclude-colors.mjs';
|
|
5
|
+
import '../formats/detailed-log.mjs';
|
|
6
|
+
|
|
7
|
+
var outputFileConfiguration = ((filename, fileTransportOptions = {})=>{
|
|
8
|
+
return {
|
|
9
|
+
level: LEVEL_LABEL,
|
|
10
|
+
levels: LEVELS,
|
|
11
|
+
format: prettyPrint(),
|
|
12
|
+
transports: [
|
|
13
|
+
new transports.Console(),
|
|
14
|
+
new transports.File({
|
|
15
|
+
level: 'error',
|
|
16
|
+
filename,
|
|
17
|
+
format: excludeColors,
|
|
18
|
+
...fileTransportOptions
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { outputFileConfiguration as default };
|
|
25
|
+
//# sourceMappingURL=output-file-configuration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-file-configuration.mjs","sources":["../../src/configs/output-file-configuration.ts"],"sourcesContent":["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"],"names":["filename","fileTransportOptions","level","LEVEL_LABEL","levels","LEVELS","format","prettyPrint","transports","Console","File","excludeColors"],"mappings":";;;;;;AAKA,8BAAe,CAAA,CACbA,QACAC,EAAAA,oBAAAA,GAAwD,EAAE,GAAA;IAE1D,OAAO;QACLC,KAAOC,EAAAA,WAAAA;QACPC,MAAQC,EAAAA,MAAAA;QACRC,MAAQC,EAAAA,WAAAA,EAAAA;QACRC,UAAY,EAAA;AACV,YAAA,IAAIA,WAAWC,OAAO,EAAA;YACtB,IAAID,UAAAA,CAAWE,IAAI,CAAC;gBAClBR,KAAO,EAAA,OAAA;AACPF,gBAAAA,QAAAA;gBACAM,MAAQK,EAAAA,aAAAA;AACR,gBAAA,GAAGV;AACL,aAAA;AACD;AACH,KAAA;AACF,CAAA;;;;"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,QAAA,MAAM,MAAM,2BAAoB,CAAC;AACjC,QAAA,MAAM,WAAW,UAAU,CAAC;AAC5B,QAAA,MAAM,KAAK,QAAsB,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const LEVELS =
|
|
6
|
-
exports.LEVELS = LEVELS;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
5
|
+
const LEVELS = winston.config.npm.levels;
|
|
7
6
|
const LEVEL_LABEL = 'silly';
|
|
7
|
+
LEVELS[LEVEL_LABEL];
|
|
8
|
+
|
|
9
|
+
exports.LEVELS = LEVELS;
|
|
8
10
|
exports.LEVEL_LABEL = LEVEL_LABEL;
|
|
9
|
-
|
|
10
|
-
exports.LEVEL = LEVEL;
|
|
11
|
-
//# sourceMappingURL=constants.js.map
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.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"],"names":["LEVELS","config","npm","levels","LEVEL_LABEL"],"mappings":";;;;AAEA,MAAMA,MAASC,GAAAA,cAAAA,CAAOC,GAAG,CAACC;AAC1B,MAAMC,WAAc,GAAA;AACNJ,MAAM,CAACI,WAAY;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../src/constants.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"],"names":["LEVELS","config","npm","levels","LEVEL_LABEL"],"mappings":";;AAEA,MAAMA,MAASC,GAAAA,MAAAA,CAAOC,GAAG,CAACC;AAC1B,MAAMC,WAAc,GAAA;AACNJ,MAAM,CAACI,WAAY;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detailed-log.d.ts","sourceRoot":"","sources":["../../src/formats/detailed-log.ts"],"names":[],"mappings":"AAEA;;;GAGG;;AACH,wBAYG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This will remove the chalk color codes from the message provided.
|
|
7
|
+
* It's used to log plain text in the log file
|
|
8
|
+
*/ var detailedLog = winston.format.printf(({ message, level, timestamp })=>{
|
|
9
|
+
if (typeof message !== 'string') {
|
|
10
|
+
return message;
|
|
11
|
+
}
|
|
12
|
+
const newMessage = `[${timestamp}] ${level}: ${message}`;
|
|
13
|
+
return newMessage.replace(// eslint-disable-next-line no-control-regex
|
|
14
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
module.exports = detailedLog;
|
|
18
|
+
//# sourceMappingURL=detailed-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detailed-log.js","sources":["../../src/formats/detailed-log.ts"],"sourcesContent":["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"],"names":["format","printf","message","level","timestamp","newMessage","replace"],"mappings":";;;;AAEA;;;IAIA,kBAAeA,cAAOC,CAAAA,MAAM,CAAC,CAAC,EAAEC,OAAO,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAA;IACzD,IAAI,OAAOF,YAAY,QAAU,EAAA;QAC/B,OAAOA,OAAAA;AACT;IAEA,MAAMG,UAAAA,GAAa,CAAC,CAAC,EAAED,SAAAA,CAAoB,EAAE,EAAED,KAAM,CAAA,EAAE,EAAED,OAAAA,CAAkB,CAAC;IAE5E,OAAOG,UAAAA,CAAWC,OAAO;IAEvB,6EACA,EAAA,EAAA,CAAA;AAEJ,CAAG,CAAA;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { format } from 'winston';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This will remove the chalk color codes from the message provided.
|
|
5
|
+
* It's used to log plain text in the log file
|
|
6
|
+
*/ var detailedLog = format.printf(({ message, level, timestamp })=>{
|
|
7
|
+
if (typeof message !== 'string') {
|
|
8
|
+
return message;
|
|
9
|
+
}
|
|
10
|
+
const newMessage = `[${timestamp}] ${level}: ${message}`;
|
|
11
|
+
return newMessage.replace(// eslint-disable-next-line no-control-regex
|
|
12
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { detailedLog as default };
|
|
16
|
+
//# sourceMappingURL=detailed-log.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detailed-log.mjs","sources":["../../src/formats/detailed-log.ts"],"sourcesContent":["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"],"names":["format","printf","message","level","timestamp","newMessage","replace"],"mappings":";;AAEA;;;IAIA,kBAAeA,MAAOC,CAAAA,MAAM,CAAC,CAAC,EAAEC,OAAO,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAA;IACzD,IAAI,OAAOF,YAAY,QAAU,EAAA;QAC/B,OAAOA,OAAAA;AACT;IAEA,MAAMG,UAAAA,GAAa,CAAC,CAAC,EAAED,SAAAA,CAAoB,EAAE,EAAED,KAAM,CAAA,EAAE,EAAED,OAAAA,CAAkB,CAAC;IAE5E,OAAOG,UAAAA,CAAWC,OAAO;IAEvB,6EACA,EAAA,EAAA,CAAA;AAEJ,CAAG,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exclude-colors.d.ts","sourceRoot":"","sources":["../../src/formats/exclude-colors.ts"],"names":[],"mappings":"AAEA;;;GAGG;;AACH,wBAUG"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* This will remove the chalk color codes from the message provided.
|
|
6
7
|
* It's used to log plain text in the log file
|
|
7
|
-
*/
|
|
8
|
-
exports.default = winston_1.format.printf(({ message }) => {
|
|
8
|
+
*/ var excludeColors = winston.format.printf(({ message })=>{
|
|
9
9
|
if (typeof message !== 'string') {
|
|
10
10
|
return message;
|
|
11
11
|
}
|
|
12
|
-
return message.replace(
|
|
13
|
-
// eslint-disable-next-line no-control-regex
|
|
12
|
+
return message.replace(// eslint-disable-next-line no-control-regex
|
|
14
13
|
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
15
14
|
});
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
module.exports = excludeColors;
|
|
17
|
+
//# sourceMappingURL=exclude-colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exclude-colors.js","
|
|
1
|
+
{"version":3,"file":"exclude-colors.js","sources":["../../src/formats/exclude-colors.ts"],"sourcesContent":["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"],"names":["format","printf","message","replace"],"mappings":";;;;AAEA;;;AAGC,IACD,oBAAeA,cAAOC,CAAAA,MAAM,CAAC,CAAC,EAAEC,OAAO,EAAE,GAAA;IACvC,IAAI,OAAOA,YAAY,QAAU,EAAA;QAC/B,OAAOA,OAAAA;AACT;IAEA,OAAOA,OAAAA,CAAQC,OAAO;IAEpB,6EACA,EAAA,EAAA,CAAA;AAEJ,CAAG,CAAA;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { format } from 'winston';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This will remove the chalk color codes from the message provided.
|
|
5
|
+
* It's used to log plain text in the log file
|
|
6
|
+
*/ var excludeColors = format.printf(({ message })=>{
|
|
7
|
+
if (typeof message !== 'string') {
|
|
8
|
+
return message;
|
|
9
|
+
}
|
|
10
|
+
return message.replace(// eslint-disable-next-line no-control-regex
|
|
11
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { excludeColors as default };
|
|
15
|
+
//# sourceMappingURL=exclude-colors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exclude-colors.mjs","sources":["../../src/formats/exclude-colors.ts"],"sourcesContent":["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"],"names":["format","printf","message","replace"],"mappings":";;AAEA;;;AAGC,IACD,oBAAeA,MAAOC,CAAAA,MAAM,CAAC,CAAC,EAAEC,OAAO,EAAE,GAAA;IACvC,IAAI,OAAOA,YAAY,QAAU,EAAA;QAC/B,OAAOA,OAAAA;AACT;IAEA,OAAOA,OAAAA,CAAQC,OAAO;IAEpB,6EACA,EAAA,EAAA,CAAA;AAEJ,CAAG,CAAA;;;;"}
|
package/dist/formats/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { default as prettyPrint
|
|
1
|
+
export { default as prettyPrint } from './pretty-print';
|
|
2
|
+
export type { PrettyPrintOptions } from './pretty-print';
|
|
2
3
|
export { default as levelFilter } from './level-filter';
|
|
3
4
|
export { default as excludeColors } from './exclude-colors';
|
|
5
|
+
export { default as detailedLogs } from './detailed-log';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/formats/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var prettyPrint = require('./pretty-print.js');
|
|
4
|
+
var levelFilter = require('./level-filter.js');
|
|
5
|
+
var excludeColors = require('./exclude-colors.js');
|
|
6
|
+
var detailedLog = require('./detailed-log.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.prettyPrint = prettyPrint;
|
|
11
|
+
exports.levelFilter = levelFilter;
|
|
12
|
+
exports.excludeColors = excludeColors;
|
|
13
|
+
exports.detailedLogs = detailedLog;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as prettyPrint } from './pretty-print.mjs';
|
|
2
|
+
export { default as levelFilter } from './level-filter.mjs';
|
|
3
|
+
export { default as excludeColors } from './exclude-colors.mjs';
|
|
4
|
+
export { default as detailedLogs } from './detailed-log.mjs';
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level-filter.d.ts","sourceRoot":"","sources":["../../src/formats/level-filter.ts"],"names":[],"mappings":"oCAE2B,MAAM,EAAE;AAAnC,wBAEE"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
5
|
+
var levelFilter = ((...levels)=>{
|
|
6
|
+
return winston.format((info)=>levels.some((level)=>info.level.includes(level)) ? info : false)();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
module.exports = levelFilter;
|
|
10
|
+
//# sourceMappingURL=level-filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level-filter.js","
|
|
1
|
+
{"version":3,"file":"level-filter.js","sources":["../../src/formats/level-filter.ts"],"sourcesContent":["import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n"],"names":["levels","format","info","some","level","includes"],"mappings":";;;;AAEA,kBAAe,CAAA,CAAC,GAAGA,MAAAA,GAAAA;AACjB,IAAA,OAAOC,cAAO,CAAA,CAACC,IAAUF,GAAAA,MAAAA,CAAOG,IAAI,CAAC,CAACC,KAAUF,GAAAA,IAAAA,CAAKE,KAAK,CAACC,QAAQ,CAACD,UAAUF,IAAO,GAAA,KAAA,CAAA,EAAA;AACvF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level-filter.mjs","sources":["../../src/formats/level-filter.ts"],"sourcesContent":["import { format } from 'winston';\n\nexport default (...levels: string[]) => {\n return format((info) => (levels.some((level) => info.level.includes(level)) ? info : false))();\n};\n"],"names":["levels","format","info","some","level","includes"],"mappings":";;AAEA,kBAAe,CAAA,CAAC,GAAGA,MAAAA,GAAAA;AACjB,IAAA,OAAOC,MAAO,CAAA,CAACC,IAAUF,GAAAA,MAAAA,CAAOG,IAAI,CAAC,CAACC,KAAUF,GAAAA,IAAAA,CAAKE,KAAK,CAACC,QAAQ,CAACD,UAAUF,IAAO,GAAA,KAAA,CAAA,EAAA;AACvF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-errors.d.ts","sourceRoot":"","sources":["../../src/formats/log-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,SAAS,EAAE,OAAO,CAAC,UAMvB,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
|
|
5
|
+
const logErrors = winston.format((info)=>{
|
|
5
6
|
if (info instanceof Error) {
|
|
6
|
-
return {
|
|
7
|
+
return {
|
|
8
|
+
...info,
|
|
9
|
+
message: `${info.message}${info.stack ? `\n${info.stack}` : ''}`
|
|
10
|
+
};
|
|
7
11
|
}
|
|
8
12
|
return info;
|
|
9
13
|
});
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
module.exports = logErrors;
|
|
16
|
+
//# sourceMappingURL=log-errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-errors.js","
|
|
1
|
+
{"version":3,"file":"log-errors.js","sources":["../../src/formats/log-errors.ts"],"sourcesContent":["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"],"names":["logErrors","format","info","Error","message","stack"],"mappings":";;;;AAEMA,MAAAA,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;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { format } from 'winston';
|
|
2
|
+
|
|
3
|
+
const logErrors = format((info)=>{
|
|
4
|
+
if (info instanceof Error) {
|
|
5
|
+
return {
|
|
6
|
+
...info,
|
|
7
|
+
message: `${info.message}${info.stack ? `\n${info.stack}` : ''}`
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return info;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { logErrors as default };
|
|
14
|
+
//# sourceMappingURL=log-errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-errors.mjs","sources":["../../src/formats/log-errors.ts"],"sourcesContent":["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"],"names":["logErrors","format","info","Error","message","stack"],"mappings":";;AAEMA,MAAAA,SAAAA,GAAgCC,OAAO,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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty-print.d.ts","sourceRoot":"","sources":["../../src/formats/pretty-print.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,SAAS,CAAC;AAK1C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;IAC1D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;mCACsB,kBAAkB,KAAQ,QAAQ,MAAM;AAAjE,wBA0BE"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const winston_1 = require("winston");
|
|
7
|
-
const log_errors_1 = __importDefault(require("./log-errors"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
var logErrors = require('./log-errors.js');
|
|
5
|
+
|
|
8
6
|
const defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
|
|
9
7
|
/**
|
|
10
8
|
* Create a pretty print formatter for a winston logger
|
|
11
9
|
* @param options
|
|
12
|
-
*/
|
|
13
|
-
exports.default = (options = {}) => {
|
|
10
|
+
*/ var prettyPrint = ((options = {})=>{
|
|
14
11
|
const { timestamps = true, colors = true } = options;
|
|
15
12
|
const handlers = [];
|
|
16
13
|
if (timestamps) {
|
|
17
|
-
handlers.push(
|
|
18
|
-
format: timestamps === true ? defaultTimestampFormat : timestamps
|
|
14
|
+
handlers.push(winston.format.timestamp({
|
|
15
|
+
format: timestamps === true ? defaultTimestampFormat : timestamps
|
|
19
16
|
}));
|
|
20
17
|
}
|
|
21
18
|
if (colors) {
|
|
22
|
-
handlers.push(
|
|
19
|
+
handlers.push(winston.format.colorize());
|
|
23
20
|
}
|
|
24
|
-
handlers.push((
|
|
25
|
-
handlers.push(
|
|
21
|
+
handlers.push(logErrors());
|
|
22
|
+
handlers.push(winston.format.printf(({ level, message, timestamp })=>{
|
|
26
23
|
return `${timestamps ? `[${timestamp}] ` : ''}${level}: ${message}`;
|
|
27
24
|
}));
|
|
28
|
-
return
|
|
29
|
-
};
|
|
30
|
-
|
|
25
|
+
return winston.format.combine(...handlers);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
module.exports = prettyPrint;
|
|
29
|
+
//# sourceMappingURL=pretty-print.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pretty-print.js","
|
|
1
|
+
{"version":3,"file":"pretty-print.js","sources":["../../src/formats/pretty-print.ts"],"sourcesContent":["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"],"names":["defaultTimestampFormat","options","timestamps","colors","handlers","push","format","timestamp","colorize","logErrors","printf","level","message","combine"],"mappings":";;;;;AAGA,MAAMA,sBAAyB,GAAA,yBAAA;AAa/B;;;AAGC,IACD,kBAAe,CAAA,CAACC,OAAAA,GAA8B,EAAE,GAAA;AAC9C,IAAA,MAAM,EAAEC,UAAa,GAAA,IAAI,EAAEC,MAAS,GAAA,IAAI,EAAE,GAAGF,OAAAA;AAE7C,IAAA,MAAMG,WAA6B,EAAE;AAErC,IAAA,IAAIF,UAAY,EAAA;AACdE,QAAAA,QAAAA,CAASC,IAAI,CACXC,cAAOC,CAAAA,SAAS,CAAC;YACfD,MAAQJ,EAAAA,UAAAA,KAAe,OAAOF,sBAAyBE,GAAAA;AACzD,SAAA,CAAA,CAAA;AAEJ;AAEA,IAAA,IAAIC,MAAQ,EAAA;QACVC,QAASC,CAAAA,IAAI,CAACC,cAAAA,CAAOE,QAAQ,EAAA,CAAA;AAC/B;AAEAJ,IAAAA,QAAAA,CAASC,IAAI,CAACI,SAAAA,EAAAA,CAAAA;AAEdL,IAAAA,QAAAA,CAASC,IAAI,CACXC,cAAOI,CAAAA,MAAM,CAAC,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEL,SAAS,EAAE,GAAA;AAC1C,QAAA,OAAO,CAAC,EAAEL,UAAAA,GAAa,CAAC,CAAC,EAAEK,SAAoB,CAAA,EAAE,CAAC,GAAG,GAAG,EAAEI,KAAAA,CAAM,EAAE,EAAEC,QAAkB,CAAC;AACzF,KAAA,CAAA,CAAA;IAGF,OAAON,cAAAA,CAAOO,OAAO,CAAIT,GAAAA,QAAAA,CAAAA;AAC3B,CAAA;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { format } from 'winston';
|
|
2
|
+
import logErrors from './log-errors.mjs';
|
|
3
|
+
|
|
4
|
+
const defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
|
|
5
|
+
/**
|
|
6
|
+
* Create a pretty print formatter for a winston logger
|
|
7
|
+
* @param options
|
|
8
|
+
*/ var prettyPrint = ((options = {})=>{
|
|
9
|
+
const { timestamps = true, colors = true } = options;
|
|
10
|
+
const handlers = [];
|
|
11
|
+
if (timestamps) {
|
|
12
|
+
handlers.push(format.timestamp({
|
|
13
|
+
format: timestamps === true ? defaultTimestampFormat : timestamps
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
if (colors) {
|
|
17
|
+
handlers.push(format.colorize());
|
|
18
|
+
}
|
|
19
|
+
handlers.push(logErrors());
|
|
20
|
+
handlers.push(format.printf(({ level, message, timestamp })=>{
|
|
21
|
+
return `${timestamps ? `[${timestamp}] ` : ''}${level}: ${message}`;
|
|
22
|
+
}));
|
|
23
|
+
return format.combine(...handlers);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { prettyPrint as default };
|
|
27
|
+
//# sourceMappingURL=pretty-print.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty-print.mjs","sources":["../../src/formats/pretty-print.ts"],"sourcesContent":["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"],"names":["defaultTimestampFormat","options","timestamps","colors","handlers","push","format","timestamp","colorize","logErrors","printf","level","message","combine"],"mappings":";;;AAGA,MAAMA,sBAAyB,GAAA,yBAAA;AAa/B;;;AAGC,IACD,kBAAe,CAAA,CAACC,OAAAA,GAA8B,EAAE,GAAA;AAC9C,IAAA,MAAM,EAAEC,UAAa,GAAA,IAAI,EAAEC,MAAS,GAAA,IAAI,EAAE,GAAGF,OAAAA;AAE7C,IAAA,MAAMG,WAA6B,EAAE;AAErC,IAAA,IAAIF,UAAY,EAAA;AACdE,QAAAA,QAAAA,CAASC,IAAI,CACXC,MAAOC,CAAAA,SAAS,CAAC;YACfD,MAAQJ,EAAAA,UAAAA,KAAe,OAAOF,sBAAyBE,GAAAA;AACzD,SAAA,CAAA,CAAA;AAEJ;AAEA,IAAA,IAAIC,MAAQ,EAAA;QACVC,QAASC,CAAAA,IAAI,CAACC,MAAAA,CAAOE,QAAQ,EAAA,CAAA;AAC/B;AAEAJ,IAAAA,QAAAA,CAASC,IAAI,CAACI,SAAAA,EAAAA,CAAAA;AAEdL,IAAAA,QAAAA,CAASC,IAAI,CACXC,MAAOI,CAAAA,MAAM,CAAC,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEL,SAAS,EAAE,GAAA;AAC1C,QAAA,OAAO,CAAC,EAAEL,UAAAA,GAAa,CAAC,CAAC,EAAEK,SAAoB,CAAA,EAAE,CAAC,GAAG,GAAG,EAAEI,KAAAA,CAAM,EAAE,EAAEC,QAAkB,CAAC;AACzF,KAAA,CAAA,CAAA;IAGF,OAAON,MAAAA,CAAOO,OAAO,CAAIT,GAAAA,QAAAA,CAAAA;AAC3B,CAAA;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as winston from 'winston';
|
|
2
2
|
import * as configs from './configs';
|
|
3
3
|
export * as formats from './formats';
|
|
4
|
+
export type Logger = winston.Logger;
|
|
4
5
|
declare const createLogger: (userConfiguration?: winston.LoggerOptions) => winston.Logger;
|
|
5
6
|
export { createLogger, winston, configs };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAEpC,QAAA,MAAM,YAAY,uBAAuB,QAAQ,aAAa,KAAQ,cAMrE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const configs = __importStar(require("./configs"));
|
|
30
|
-
exports.configs = configs;
|
|
31
|
-
exports.formats = __importStar(require("./formats"));
|
|
32
|
-
const createLogger = (userConfiguration = {}) => {
|
|
33
|
-
const configuration = configs.createDefaultConfiguration();
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var winston = require('winston');
|
|
4
|
+
var index = require('./configs/index.js');
|
|
5
|
+
var index$1 = require('./formats/index.js');
|
|
6
|
+
var defaultConfiguration = require('./configs/default-configuration.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var winston__namespace = /*#__PURE__*/_interopNamespaceDefault(winston);
|
|
26
|
+
|
|
27
|
+
const createLogger = (userConfiguration = {})=>{
|
|
28
|
+
const configuration = defaultConfiguration();
|
|
34
29
|
Object.assign(configuration, userConfiguration);
|
|
35
|
-
return
|
|
30
|
+
return winston__namespace.createLogger(configuration);
|
|
36
31
|
};
|
|
32
|
+
|
|
33
|
+
exports.winston = winston__namespace;
|
|
34
|
+
exports.configs = index;
|
|
35
|
+
exports.formats = index$1;
|
|
37
36
|
exports.createLogger = createLogger;
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["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":["createLogger","userConfiguration","configuration","configs","Object","assign","winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,YAAe,GAAA,CAACC,iBAA2C,GAAA,EAAE,GAAA;IACjE,MAAMC,aAAAA,GAAgBC,oBAAkC,EAAA;IAExDC,MAAOC,CAAAA,MAAM,CAACH,aAAeD,EAAAA,iBAAAA,CAAAA;IAE7B,OAAOK,kBAAAA,CAAQN,YAAY,CAACE,aAAAA,CAAAA;AAC9B;;;;;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as winston from 'winston';
|
|
2
|
+
export { winston };
|
|
3
|
+
import * as index from './configs/index.mjs';
|
|
4
|
+
export { index as configs };
|
|
5
|
+
import * as index$1 from './formats/index.mjs';
|
|
6
|
+
export { index$1 as formats };
|
|
7
|
+
import defaultConfiguration from './configs/default-configuration.mjs';
|
|
8
|
+
|
|
9
|
+
const createLogger = (userConfiguration = {})=>{
|
|
10
|
+
const configuration = defaultConfiguration();
|
|
11
|
+
Object.assign(configuration, userConfiguration);
|
|
12
|
+
return winston.createLogger(configuration);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { createLogger };
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["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":["createLogger","userConfiguration","configuration","configs","Object","assign","winston"],"mappings":";;;;;;;;AAOA,MAAMA,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": "0.0.0-next.
|
|
3
|
+
"version": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d",
|
|
4
4
|
"description": "Strapi's logger",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -24,29 +24,31 @@
|
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.mjs",
|
|
28
|
+
"source": "./src/index.ts",
|
|
27
29
|
"types": "./dist/index.d.ts",
|
|
28
30
|
"files": [
|
|
29
|
-
"
|
|
31
|
+
"dist/"
|
|
30
32
|
],
|
|
31
33
|
"scripts": {
|
|
32
|
-
"build": "run -T
|
|
33
|
-
"build:
|
|
34
|
-
"
|
|
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
|
-
"
|
|
37
|
-
"
|
|
38
|
+
"lint": "run -T eslint .",
|
|
39
|
+
"test:ts": "run -T tsc --noEmit",
|
|
40
|
+
"watch": "run -T rollup -c -w"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"lodash": "4.17.21",
|
|
41
|
-
"winston": "3.
|
|
44
|
+
"winston": "3.10.0"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
|
-
"eslint-config-custom": "0.0.0-next.
|
|
45
|
-
"tsconfig": "0.0.0-next.
|
|
47
|
+
"eslint-config-custom": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d",
|
|
48
|
+
"tsconfig": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d"
|
|
46
49
|
},
|
|
47
50
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
51
|
+
"node": ">=18.0.0 <=22.x.x",
|
|
49
52
|
"npm": ">=6.0.0"
|
|
50
|
-
}
|
|
51
|
-
"gitHead": "f7babb775ed9a7e18d8351cb7f74c63e016323c4"
|
|
53
|
+
}
|
|
52
54
|
}
|