@orion-js/logger 3.1.0-alpha.13 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/formats.js CHANGED
@@ -31,7 +31,7 @@ exports.textConsoleTransport = new winston_1.transports.Console({
31
31
  handleExceptions: true,
32
32
  format: exports.textConsoleFormat
33
33
  });
34
- exports.jsonConsoleFormat = combine(metadata({ fillExcept: ['fileName', 'level', 'message'] }), metaError(), timestamp(), json({ replacer: null, space: 2 }));
34
+ exports.jsonConsoleFormat = combine(metadata({ fillExcept: ['fileName', 'level', 'message'] }), metaError(), timestamp(), json());
35
35
  exports.jsonConsoleTransport = new winston_1.transports.Console({
36
36
  handleExceptions: true,
37
37
  format: exports.jsonConsoleFormat
@@ -20,6 +20,16 @@ const improveFileName = (path) => {
20
20
  if (path.includes('.orion/build')) {
21
21
  return path.replace(/^.+\.orion\/build\//, '');
22
22
  }
23
+ if (path.includes('/node_modules/@')) {
24
+ const after = path.split('/node_modules/')[1];
25
+ const parts = after.split('/');
26
+ return `${parts[0]}/${parts[1]}`;
27
+ }
28
+ if (path.includes('/node_modules/')) {
29
+ const after = path.split('/node_modules/')[1];
30
+ const parts = after.split('/');
31
+ return `${parts[0]}`;
32
+ }
23
33
  return path;
24
34
  };
25
35
  exports.improveFileName = improveFileName;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getFileName_1 = require("./getFileName");
4
+ describe('GetFileName', () => {
5
+ it('Should clean @package in node_modules', () => {
6
+ const fileName = '/Users/nicolaslopezj/Code/Projects/justo/drivers/server/node_modules/@orion-js/dogs/lib/services/WorkerService.js:39:25';
7
+ const improvedFileName = (0, getFileName_1.improveFileName)(fileName);
8
+ expect(improvedFileName).toBe('@orion-js/dogs');
9
+ });
10
+ it('Should clean simple package in node modules', () => {
11
+ const fileName = '/Users/nicolaslopezj/Code/Projects/justo/drivers/server/node_modules/dogs/lib/services/WorkerService.js:39:25';
12
+ const improvedFileName = (0, getFileName_1.improveFileName)(fileName);
13
+ expect(improvedFileName).toBe('dogs');
14
+ });
15
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/logger",
3
- "version": "3.1.0-alpha.13",
3
+ "version": "3.1.0",
4
4
  "main": "lib/index.js",
5
5
  "author": "nicolaslopezj",
6
6
  "license": "MIT",
@@ -25,5 +25,5 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "gitHead": "9c815a15f5f4babc6de240e26244f09424fbc716"
28
+ "gitHead": "afeb686374cedd6e4b2827e82d3354bff62a48e0"
29
29
  }