nextrans-logger 0.1.11 → 0.1.12

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/index.cjs CHANGED
@@ -76,7 +76,7 @@ class Logging {
76
76
  const slack = (level) => new winston_slack_webhook_transport_1.default({
77
77
  level,
78
78
  webhookUrl: this.slackWebhook,
79
- formatter: (log) => ({ text: `:sos: ${formatMessage(log, this.env)}` }),
79
+ formatter: (log) => ({ text: `:sos: ${formatMessage(log, this.env).replace(/\[31m/g, '').replace(/\[39m/g, '')}` }),
80
80
  });
81
81
  transportsData.push(slack('error'));
82
82
  }
@@ -101,7 +101,7 @@ class Logging {
101
101
  region: (_c = this.cloudwatchOption) === null || _c === void 0 ? void 0 : _c.region,
102
102
  credentials: (_d = this === null || this === void 0 ? void 0 : this.cloudwatchOption) === null || _d === void 0 ? void 0 : _d.credentials,
103
103
  },
104
- messageFormatter: (log) => this.lineFormat(log),
104
+ messageFormatter: (log) => this.lineFormat(log).replace(/\[31m/g, '').replace(/\[39m/g, ''),
105
105
  });
106
106
  };
107
107
  log.add(cloudwatch());
package/lib/index.js CHANGED
@@ -71,7 +71,7 @@ export default class Logging {
71
71
  const slack = (level) => new SlackHook({
72
72
  level,
73
73
  webhookUrl: this.slackWebhook,
74
- formatter: (log) => ({ text: `:sos: ${formatMessage(log, this.env)}` }),
74
+ formatter: (log) => ({ text: `:sos: ${formatMessage(log, this.env).replace(/\[31m/g, '').replace(/\[39m/g, '')}` }),
75
75
  });
76
76
  transportsData.push(slack('error'));
77
77
  }
@@ -94,7 +94,7 @@ export default class Logging {
94
94
  region: this.cloudwatchOption?.region,
95
95
  credentials: this?.cloudwatchOption?.credentials,
96
96
  },
97
- messageFormatter: (log) => this.lineFormat(log),
97
+ messageFormatter: (log) => this.lineFormat(log).replace(/\[31m/g, '').replace(/\[39m/g, ''),
98
98
  });
99
99
  log.add(cloudwatch());
100
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextrans-logger",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Logging for nextrans app service",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",