@backstage/backend-app-api 0.7.4 → 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 CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 0.7.4
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-app-api",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
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
- redacter.format,
848
- (_a = options.format) != null ? _a : defaultFormatter
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,24 +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 (Object.hasOwn(obj, key)) {
867
- if (typeof obj[key] === "object") {
868
- obj[key] = replace(obj[key]);
869
- } else if (typeof obj[key] === "string") {
870
- try {
871
- obj[key] = (_a = obj[key]) == null ? void 0 : _a.replace(redactionPattern, "[REDACTED]");
872
- } catch {
873
- }
874
- }
875
- }
876
- }
877
- return obj;
878
- };
879
864
  return {
880
- format: winston.format(replace)(),
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
+ })(),
881
873
  add(newRedactions) {
882
874
  let added = 0;
883
875
  for (const redactionToTrim of newRedactions) {