@backstage/backend-app-api 0.7.3 → 0.7.5
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/CHANGELOG.md +12 -0
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +11 -16
- package/dist/index.cjs.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage/backend-app-api
|
|
2
2
|
|
|
3
|
+
## 0.7.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- da155d1: Fixing issue with log meta fields possibly being circular refs
|
|
8
|
+
|
|
9
|
+
## 0.7.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ce87d0e: Fixed a potential crash when passing an object with a `null` prototype as log meta.
|
|
14
|
+
|
|
3
15
|
## 0.7.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -20,6 +20,7 @@ var minimatch = require('minimatch');
|
|
|
20
20
|
var errors = require('@backstage/errors');
|
|
21
21
|
var crypto = require('crypto');
|
|
22
22
|
var winston = require('winston');
|
|
23
|
+
var tripleBeam = require('triple-beam');
|
|
23
24
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
24
25
|
var alpha = require('@backstage/backend-plugin-api/alpha');
|
|
25
26
|
var luxon = require('luxon');
|
|
@@ -844,8 +845,8 @@ const _WinstonLogger = class _WinstonLogger {
|
|
|
844
845
|
let logger = winston.createLogger({
|
|
845
846
|
level: process.env.LOG_LEVEL || options.level || "info",
|
|
846
847
|
format: winston.format.combine(
|
|
847
|
-
|
|
848
|
-
|
|
848
|
+
(_a = options.format) != null ? _a : defaultFormatter,
|
|
849
|
+
redacter.format
|
|
849
850
|
),
|
|
850
851
|
transports: (_b = options.transports) != null ? _b : new winston.transports.Console()
|
|
851
852
|
});
|
|
@@ -860,21 +861,15 @@ const _WinstonLogger = class _WinstonLogger {
|
|
|
860
861
|
static redacter() {
|
|
861
862
|
const redactionSet = /* @__PURE__ */ new Set();
|
|
862
863
|
let redactionPattern = void 0;
|
|
863
|
-
const replace = (obj) => {
|
|
864
|
-
var _a;
|
|
865
|
-
for (const key in obj) {
|
|
866
|
-
if (obj.hasOwnProperty(key)) {
|
|
867
|
-
if (typeof obj[key] === "object") {
|
|
868
|
-
obj[key] = replace(obj[key]);
|
|
869
|
-
} else if (typeof obj[key] === "string") {
|
|
870
|
-
obj[key] = (_a = obj[key]) == null ? void 0 : _a.replace(redactionPattern, "[REDACTED]");
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return obj;
|
|
875
|
-
};
|
|
876
864
|
return {
|
|
877
|
-
format: winston.format(
|
|
865
|
+
format: winston.format((obj) => {
|
|
866
|
+
var _a, _b;
|
|
867
|
+
if (!redactionPattern || !obj) {
|
|
868
|
+
return obj;
|
|
869
|
+
}
|
|
870
|
+
obj[tripleBeam.MESSAGE] = (_b = (_a = obj[tripleBeam.MESSAGE]) == null ? void 0 : _a.replace) == null ? void 0 : _b.call(_a, redactionPattern, "[REDACTED]");
|
|
871
|
+
return obj;
|
|
872
|
+
})(),
|
|
878
873
|
add(newRedactions) {
|
|
879
874
|
let added = 0;
|
|
880
875
|
for (const redactionToTrim of newRedactions) {
|