@strapi/logger 0.0.0-next.f8af92b375dc730ba47ed2117f25df893aae696c → 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.
Files changed (52) hide show
  1. package/LICENSE +18 -3
  2. package/dist/configs/default-configuration.js +21 -0
  3. package/dist/configs/default-configuration.js.map +1 -0
  4. package/dist/configs/default-configuration.mjs +19 -0
  5. package/dist/configs/default-configuration.mjs.map +1 -0
  6. package/dist/configs/index.js +10 -0
  7. package/dist/configs/index.js.map +1 -0
  8. package/dist/configs/index.mjs +3 -0
  9. package/dist/configs/index.mjs.map +1 -0
  10. package/dist/configs/output-file-configuration.d.ts +2 -2
  11. package/dist/configs/output-file-configuration.d.ts.map +1 -1
  12. package/dist/configs/output-file-configuration.js +27 -0
  13. package/dist/configs/output-file-configuration.js.map +1 -0
  14. package/dist/configs/output-file-configuration.mjs +25 -0
  15. package/dist/configs/output-file-configuration.mjs.map +1 -0
  16. package/dist/constants.js +11 -0
  17. package/dist/constants.js.map +1 -0
  18. package/dist/constants.mjs +8 -0
  19. package/dist/constants.mjs.map +1 -0
  20. package/dist/formats/detailed-log.d.ts +7 -0
  21. package/dist/formats/detailed-log.d.ts.map +1 -0
  22. package/dist/formats/detailed-log.js +18 -0
  23. package/dist/formats/detailed-log.js.map +1 -0
  24. package/dist/formats/detailed-log.mjs +16 -0
  25. package/dist/formats/detailed-log.mjs.map +1 -0
  26. package/dist/formats/exclude-colors.js +17 -0
  27. package/dist/formats/exclude-colors.js.map +1 -0
  28. package/dist/formats/exclude-colors.mjs +15 -0
  29. package/dist/formats/exclude-colors.mjs.map +1 -0
  30. package/dist/formats/index.d.ts +1 -0
  31. package/dist/formats/index.d.ts.map +1 -1
  32. package/dist/formats/index.js +14 -0
  33. package/dist/formats/index.js.map +1 -0
  34. package/dist/formats/index.mjs +5 -0
  35. package/dist/formats/index.mjs.map +1 -0
  36. package/dist/formats/level-filter.js +10 -0
  37. package/dist/formats/level-filter.js.map +1 -0
  38. package/dist/formats/level-filter.mjs +8 -0
  39. package/dist/formats/level-filter.mjs.map +1 -0
  40. package/dist/formats/log-errors.js +16 -0
  41. package/dist/formats/log-errors.js.map +1 -0
  42. package/dist/formats/log-errors.mjs +14 -0
  43. package/dist/formats/log-errors.mjs.map +1 -0
  44. package/dist/formats/pretty-print.js +29 -0
  45. package/dist/formats/pretty-print.js.map +1 -0
  46. package/dist/formats/pretty-print.mjs +27 -0
  47. package/dist/formats/pretty-print.mjs.map +1 -0
  48. package/dist/index.js +23 -93
  49. package/dist/index.js.map +1 -1
  50. package/dist/index.mjs +14 -87
  51. package/dist/index.mjs.map +1 -1
  52. package/package.json +10 -10
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 in "ee/LICENSE".
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, 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, 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
22
- SOFTWARE.
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,21 @@
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 = (()=>{
10
+ return {
11
+ level: constants.LEVEL_LABEL,
12
+ levels: constants.LEVELS,
13
+ format: prettyPrint(),
14
+ transports: [
15
+ new winston.transports.Console()
16
+ ]
17
+ };
18
+ });
19
+
20
+ module.exports = defaultConfiguration;
21
+ //# sourceMappingURL=default-configuration.js.map
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ export { default as createDefaultConfiguration } from './default-configuration.mjs';
2
+ export { default as createOutputFileConfiguration } from './output-file-configuration.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +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
4
  //# sourceMappingURL=output-file-configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"output-file-configuration.d.ts","sourceRoot":"","sources":["../../src/configs/output-file-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,SAAS,CAAC;mCAK1B,MAAM,KAAG,aAAa;AAAhD,wBAUE"}
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"}
@@ -0,0 +1,27 @@
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 = {})=>{
10
+ return {
11
+ level: constants.LEVEL_LABEL,
12
+ levels: constants.LEVELS,
13
+ format: prettyPrint(),
14
+ transports: [
15
+ new winston.transports.Console(),
16
+ new winston.transports.File({
17
+ level: 'error',
18
+ filename,
19
+ format: excludeColors,
20
+ ...fileTransportOptions
21
+ })
22
+ ]
23
+ };
24
+ });
25
+
26
+ module.exports = outputFileConfiguration;
27
+ //# sourceMappingURL=output-file-configuration.js.map
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var winston = require('winston');
4
+
5
+ const LEVELS = winston.config.npm.levels;
6
+ const LEVEL_LABEL = 'silly';
7
+ LEVELS[LEVEL_LABEL];
8
+
9
+ exports.LEVELS = LEVELS;
10
+ exports.LEVEL_LABEL = LEVEL_LABEL;
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
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,8 @@
1
+ import { config } from 'winston';
2
+
3
+ const LEVELS = config.npm.levels;
4
+ const LEVEL_LABEL = 'silly';
5
+ LEVELS[LEVEL_LABEL];
6
+
7
+ export { LEVELS, LEVEL_LABEL };
8
+ //# sourceMappingURL=constants.mjs.map
@@ -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,7 @@
1
+ /**
2
+ * This will remove the chalk color codes from the message provided.
3
+ * It's used to log plain text in the log file
4
+ */
5
+ declare const _default: import("logform").Format;
6
+ export default _default;
7
+ //# sourceMappingURL=detailed-log.d.ts.map
@@ -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,17 @@
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 excludeColors = winston.format.printf(({ message })=>{
9
+ if (typeof message !== 'string') {
10
+ return message;
11
+ }
12
+ return message.replace(// eslint-disable-next-line no-control-regex
13
+ /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
14
+ });
15
+
16
+ module.exports = excludeColors;
17
+ //# sourceMappingURL=exclude-colors.js.map
@@ -0,0 +1 @@
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;;;;"}
@@ -2,4 +2,5 @@ export { default as prettyPrint } from './pretty-print';
2
2
  export type { PrettyPrintOptions } from './pretty-print';
3
3
  export { default as levelFilter } from './level-filter';
4
4
  export { default as excludeColors } from './exclude-colors';
5
+ export { default as detailedLogs } from './detailed-log';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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,10 @@
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
@@ -0,0 +1 @@
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,8 @@
1
+ import { format } from 'winston';
2
+
3
+ var levelFilter = ((...levels)=>{
4
+ return format((info)=>levels.some((level)=>info.level.includes(level)) ? info : false)();
5
+ });
6
+
7
+ export { levelFilter as default };
8
+ //# sourceMappingURL=level-filter.mjs.map
@@ -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,16 @@
1
+ 'use strict';
2
+
3
+ var winston = require('winston');
4
+
5
+ const logErrors = winston.format((info)=>{
6
+ if (info instanceof Error) {
7
+ return {
8
+ ...info,
9
+ message: `${info.message}${info.stack ? `\n${info.stack}` : ''}`
10
+ };
11
+ }
12
+ return info;
13
+ });
14
+
15
+ module.exports = logErrors;
16
+ //# sourceMappingURL=log-errors.js.map
@@ -0,0 +1 @@
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,29 @@
1
+ 'use strict';
2
+
3
+ var winston = require('winston');
4
+ var logErrors = require('./log-errors.js');
5
+
6
+ const defaultTimestampFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
7
+ /**
8
+ * Create a pretty print formatter for a winston logger
9
+ * @param options
10
+ */ var prettyPrint = ((options = {})=>{
11
+ const { timestamps = true, colors = true } = options;
12
+ const handlers = [];
13
+ if (timestamps) {
14
+ handlers.push(winston.format.timestamp({
15
+ format: timestamps === true ? defaultTimestampFormat : timestamps
16
+ }));
17
+ }
18
+ if (colors) {
19
+ handlers.push(winston.format.colorize());
20
+ }
21
+ handlers.push(logErrors());
22
+ handlers.push(winston.format.printf(({ level, message, timestamp })=>{
23
+ return `${timestamps ? `[${timestamp}] ` : ''}${level}: ${message}`;
24
+ }));
25
+ return winston.format.combine(...handlers);
26
+ });
27
+
28
+ module.exports = prettyPrint;
29
+ //# sourceMappingURL=pretty-print.js.map
@@ -0,0 +1 @@
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.js CHANGED
@@ -1,107 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const winston = require("winston");
4
- function _interopNamespace(e) {
5
- if (e && e.__esModule)
6
- return e;
7
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
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);
8
10
  if (e) {
9
- for (const k in e) {
10
- if (k !== "default") {
11
- const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
14
  Object.defineProperty(n, k, d.get ? d : {
13
15
  enumerable: true,
14
- get: () => e[k]
16
+ get: function () { return e[k]; }
15
17
  });
16
18
  }
17
- }
19
+ });
18
20
  }
19
21
  n.default = e;
20
22
  return Object.freeze(n);
21
23
  }
22
- const winston__namespace = /* @__PURE__ */ _interopNamespace(winston);
23
- const LEVELS = winston.config.npm.levels;
24
- const LEVEL_LABEL = "silly";
25
- LEVELS[LEVEL_LABEL];
26
- const logErrors = winston.format((info) => {
27
- if (info instanceof Error) {
28
- return { ...info, message: `${info.message}${info.stack ? `
29
- ${info.stack}` : ""}` };
30
- }
31
- return info;
32
- });
33
- const defaultTimestampFormat = "YYYY-MM-DD HH:mm:ss.SSS";
34
- const prettyPrint = (options = {}) => {
35
- const { timestamps = true, colors = true } = options;
36
- const handlers = [];
37
- if (timestamps) {
38
- handlers.push(
39
- winston.format.timestamp({
40
- format: timestamps === true ? defaultTimestampFormat : timestamps
41
- })
42
- );
43
- }
44
- if (colors) {
45
- handlers.push(winston.format.colorize());
46
- }
47
- handlers.push(logErrors());
48
- handlers.push(
49
- winston.format.printf(({ level, message, timestamp }) => {
50
- return `${timestamps ? `[${timestamp}] ` : ""}${level}: ${message}`;
51
- })
52
- );
53
- return winston.format.combine(...handlers);
54
- };
55
- const levelFilter = (...levels) => {
56
- return winston.format((info) => levels.some((level) => info.level.includes(level)) ? info : false)();
57
- };
58
- const excludeColors = winston.format.printf(({ message }) => {
59
- if (typeof message !== "string") {
60
- return message;
61
- }
62
- return message.replace(
63
- // eslint-disable-next-line no-control-regex
64
- /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
65
- ""
66
- );
67
- });
68
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
- __proto__: null,
70
- excludeColors,
71
- levelFilter,
72
- prettyPrint
73
- }, Symbol.toStringTag, { value: "Module" }));
74
- const defaultConfiguration = () => {
75
- return {
76
- level: LEVEL_LABEL,
77
- levels: LEVELS,
78
- format: prettyPrint(),
79
- transports: [new winston.transports.Console()]
80
- };
81
- };
82
- const outputFileConfiguration = (filename) => {
83
- return {
84
- level: LEVEL_LABEL,
85
- levels: LEVELS,
86
- format: prettyPrint(),
87
- transports: [
88
- new winston.transports.Console(),
89
- new winston.transports.File({ level: "error", filename, format: excludeColors })
90
- ]
91
- };
92
- };
93
- const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
94
- __proto__: null,
95
- createDefaultConfiguration: defaultConfiguration,
96
- createOutputFileConfiguration: outputFileConfiguration
97
- }, Symbol.toStringTag, { value: "Module" }));
98
- const createLogger = (userConfiguration = {}) => {
99
- const configuration = defaultConfiguration();
100
- Object.assign(configuration, userConfiguration);
101
- return winston__namespace.createLogger(configuration);
24
+
25
+ var winston__namespace = /*#__PURE__*/_interopNamespaceDefault(winston);
26
+
27
+ const createLogger = (userConfiguration = {})=>{
28
+ const configuration = defaultConfiguration();
29
+ Object.assign(configuration, userConfiguration);
30
+ return winston__namespace.createLogger(configuration);
102
31
  };
32
+
103
33
  exports.winston = winston__namespace;
104
34
  exports.configs = index;
105
- exports.createLogger = createLogger;
106
35
  exports.formats = index$1;
36
+ exports.createLogger = createLogger;
107
37
  //# sourceMappingURL=index.js.map
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/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 { 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 (filename: string): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({ level: 'error', filename, format: excludeColors }),\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.createDefaultConfiguration","winston"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,SAASA,QAAAA,OAAO,IAAI;AAC1B,MAAM,cAAc;AACN,OAAO,WAAW;ACFhC,MAAM,YAAgCC,QAAAA,OAAO,CAAC,SAAS;AACrD,MAAI,gBAAgB,OAAO;AAClB,WAAA,EAAE,GAAG,MAAM,SAAS,GAAG,KAAK,OAAiB,GAAG,KAAK,QAAQ;AAAA,EAAK,KAAK,KAAK,KAAK,EAAE,GAAG;AAAA,EAC/F;AAEO,SAAA;AACT,CAAC;ACLD,MAAM,yBAAyB;AAiB/B,MAAA,cAAe,CAAC,UAA8B,CAAA,MAAuB;AACnE,QAAM,EAAE,aAAa,MAAM,SAAS,SAAS;AAE7C,QAAM,WAA6B,CAAA;AAEnC,MAAI,YAAY;AACL,aAAA;AAAA,MACPA,QAAAA,OAAO,UAAU;AAAA,QACf,QAAQ,eAAe,OAAO,yBAAyB;AAAA,MAAA,CACxD;AAAA,IAAA;AAAA,EAEL;AAEA,MAAI,QAAQ;AACD,aAAA,KAAKA,eAAO,SAAU,CAAA;AAAA,EACjC;AAES,WAAA,KAAK,WAAW;AAEhB,WAAA;AAAA,IACPA,eAAO,OAAO,CAAC,EAAE,OAAO,SAAS,gBAAgB;AACxC,aAAA,GAAG,aAAa,IAAI,SAAmB,OAAO,EAAE,GAAG,KAAK,KAAK,OAAiB;AAAA,IAAA,CACtF;AAAA,EAAA;AAGI,SAAAA,eAAO,QAAQ,GAAG,QAAQ;AACnC;AC5CA,MAAe,cAAA,IAAI,WAAqB;AACtC,SAAOA,QAAAA,OAAO,CAAC,SAAU,OAAO,KAAK,CAAC,UAAU,KAAK,MAAM,SAAS,KAAK,CAAC,IAAI,OAAO,KAAM,EAAE;AAC/F;ACEA,MAAeA,gBAAAA,QAAAA,OAAO,OAAO,CAAC,EAAE,cAAc;AACxC,MAAA,OAAO,YAAY,UAAU;AACxB,WAAA;AAAA,EACT;AAEA,SAAO,QAAQ;AAAA;AAAA,IAEb;AAAA,IACA;AAAA,EAAA;AAEJ,CAAC;;;;;;;ACZD,MAAA,uBAAe,MAAqB;AAC3B,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,YAAY;AAAA,IACpB,YAAY,CAAC,IAAIC,mBAAW,SAAS;AAAA,EAAA;AAEzC;ACNA,MAAe,0BAAA,CAAC,aAAoC;AAC3C,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,YAAY;AAAA,IACpB,YAAY;AAAA,MACV,IAAIA,QAAAA,WAAW,QAAQ;AAAA,MACvB,IAAIA,mBAAW,KAAK,EAAE,OAAO,SAAS,UAAU,QAAQ,eAAe;AAAA,IACzE;AAAA,EAAA;AAEJ;;;;;;ACRA,MAAM,eAAe,CAAC,oBAA2C,OAAuB;AAChF,QAAA,gBAAgBC;AAEf,SAAA,OAAO,eAAe,iBAAiB;AAEvC,SAAAC,mBAAQ,aAAa,aAAa;AAC3C;;;;;"}
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 CHANGED
@@ -1,89 +1,16 @@
1
- import * as winston from "winston";
2
- import { config, format, transports } from "winston";
3
- const LEVELS = config.npm.levels;
4
- const LEVEL_LABEL = "silly";
5
- LEVELS[LEVEL_LABEL];
6
- const logErrors = format((info) => {
7
- if (info instanceof Error) {
8
- return { ...info, message: `${info.message}${info.stack ? `
9
- ${info.stack}` : ""}` };
10
- }
11
- return info;
12
- });
13
- const defaultTimestampFormat = "YYYY-MM-DD HH:mm:ss.SSS";
14
- const prettyPrint = (options = {}) => {
15
- const { timestamps = true, colors = true } = options;
16
- const handlers = [];
17
- if (timestamps) {
18
- handlers.push(
19
- format.timestamp({
20
- format: timestamps === true ? defaultTimestampFormat : timestamps
21
- })
22
- );
23
- }
24
- if (colors) {
25
- handlers.push(format.colorize());
26
- }
27
- handlers.push(logErrors());
28
- handlers.push(
29
- format.printf(({ level, message, timestamp }) => {
30
- return `${timestamps ? `[${timestamp}] ` : ""}${level}: ${message}`;
31
- })
32
- );
33
- return format.combine(...handlers);
34
- };
35
- const levelFilter = (...levels) => {
36
- return format((info) => levels.some((level) => info.level.includes(level)) ? info : false)();
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
- );
47
- });
48
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49
- __proto__: null,
50
- excludeColors,
51
- levelFilter,
52
- prettyPrint
53
- }, Symbol.toStringTag, { value: "Module" }));
54
- const defaultConfiguration = () => {
55
- return {
56
- level: LEVEL_LABEL,
57
- levels: LEVELS,
58
- format: prettyPrint(),
59
- transports: [new transports.Console()]
60
- };
61
- };
62
- const outputFileConfiguration = (filename) => {
63
- return {
64
- level: LEVEL_LABEL,
65
- levels: LEVELS,
66
- format: prettyPrint(),
67
- transports: [
68
- new transports.Console(),
69
- new transports.File({ level: "error", filename, format: excludeColors })
70
- ]
71
- };
72
- };
73
- const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
- __proto__: null,
75
- createDefaultConfiguration: defaultConfiguration,
76
- createOutputFileConfiguration: outputFileConfiguration
77
- }, Symbol.toStringTag, { value: "Module" }));
78
- const createLogger = (userConfiguration = {}) => {
79
- const configuration = defaultConfiguration();
80
- Object.assign(configuration, userConfiguration);
81
- return winston.createLogger(configuration);
82
- };
83
- export {
84
- index as configs,
85
- createLogger,
86
- index$1 as formats,
87
- winston
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);
88
13
  };
14
+
15
+ export { createLogger };
89
16
  //# sourceMappingURL=index.mjs.map
@@ -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/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 { 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 (filename: string): LoggerOptions => {\n return {\n level: LEVEL_LABEL,\n levels: LEVELS,\n format: prettyPrint(),\n transports: [\n new transports.Console(),\n new transports.File({ level: 'error', filename, format: excludeColors }),\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.createDefaultConfiguration"],"mappings":";;AAEA,MAAM,SAAS,OAAO,IAAI;AAC1B,MAAM,cAAc;AACN,OAAO,WAAW;ACFhC,MAAM,YAAgC,OAAO,CAAC,SAAS;AACrD,MAAI,gBAAgB,OAAO;AAClB,WAAA,EAAE,GAAG,MAAM,SAAS,GAAG,KAAK,OAAiB,GAAG,KAAK,QAAQ;AAAA,EAAK,KAAK,KAAK,KAAK,EAAE,GAAG;AAAA,EAC/F;AAEO,SAAA;AACT,CAAC;ACLD,MAAM,yBAAyB;AAiB/B,MAAA,cAAe,CAAC,UAA8B,CAAA,MAAuB;AACnE,QAAM,EAAE,aAAa,MAAM,SAAS,SAAS;AAE7C,QAAM,WAA6B,CAAA;AAEnC,MAAI,YAAY;AACL,aAAA;AAAA,MACP,OAAO,UAAU;AAAA,QACf,QAAQ,eAAe,OAAO,yBAAyB;AAAA,MAAA,CACxD;AAAA,IAAA;AAAA,EAEL;AAEA,MAAI,QAAQ;AACD,aAAA,KAAK,OAAO,SAAU,CAAA;AAAA,EACjC;AAES,WAAA,KAAK,WAAW;AAEhB,WAAA;AAAA,IACP,OAAO,OAAO,CAAC,EAAE,OAAO,SAAS,gBAAgB;AACxC,aAAA,GAAG,aAAa,IAAI,SAAmB,OAAO,EAAE,GAAG,KAAK,KAAK,OAAiB;AAAA,IAAA,CACtF;AAAA,EAAA;AAGI,SAAA,OAAO,QAAQ,GAAG,QAAQ;AACnC;AC5CA,MAAe,cAAA,IAAI,WAAqB;AACtC,SAAO,OAAO,CAAC,SAAU,OAAO,KAAK,CAAC,UAAU,KAAK,MAAM,SAAS,KAAK,CAAC,IAAI,OAAO,KAAM,EAAE;AAC/F;ACEA,MAAe,gBAAA,OAAO,OAAO,CAAC,EAAE,cAAc;AACxC,MAAA,OAAO,YAAY,UAAU;AACxB,WAAA;AAAA,EACT;AAEA,SAAO,QAAQ;AAAA;AAAA,IAEb;AAAA,IACA;AAAA,EAAA;AAEJ,CAAC;;;;;;;ACZD,MAAA,uBAAe,MAAqB;AAC3B,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,YAAY;AAAA,IACpB,YAAY,CAAC,IAAI,WAAW,SAAS;AAAA,EAAA;AAEzC;ACNA,MAAe,0BAAA,CAAC,aAAoC;AAC3C,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,YAAY;AAAA,IACpB,YAAY;AAAA,MACV,IAAI,WAAW,QAAQ;AAAA,MACvB,IAAI,WAAW,KAAK,EAAE,OAAO,SAAS,UAAU,QAAQ,eAAe;AAAA,IACzE;AAAA,EAAA;AAEJ;;;;;;ACRA,MAAM,eAAe,CAAC,oBAA2C,OAAuB;AAChF,QAAA,gBAAgBA;AAEf,SAAA,OAAO,eAAe,iBAAiB;AAEvC,SAAA,QAAQ,aAAa,aAAa;AAC3C;"}
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.f8af92b375dc730ba47ed2117f25df893aae696c",
3
+ "version": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d",
4
4
  "description": "Strapi's logger",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -28,27 +28,27 @@
28
28
  "source": "./src/index.ts",
29
29
  "types": "./dist/index.d.ts",
30
30
  "files": [
31
- "./dist"
31
+ "dist/"
32
32
  ],
33
33
  "scripts": {
34
- "build": "pack-up 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": "pack-up 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
- "@strapi/pack-up": "0.0.0-next.f8af92b375dc730ba47ed2117f25df893aae696c",
46
- "eslint-config-custom": "0.0.0-next.f8af92b375dc730ba47ed2117f25df893aae696c",
47
- "tsconfig": "0.0.0-next.f8af92b375dc730ba47ed2117f25df893aae696c"
47
+ "eslint-config-custom": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d",
48
+ "tsconfig": "0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d"
48
49
  },
49
50
  "engines": {
50
- "node": ">=18.0.0 <=20.x.x",
51
+ "node": ">=18.0.0 <=22.x.x",
51
52
  "npm": ">=6.0.0"
52
- },
53
- "gitHead": "f8af92b375dc730ba47ed2117f25df893aae696c"
53
+ }
54
54
  }