@graphql-hive/logger 1.1.0 → 1.1.1-alpha-e92747b9f04aa6ae4f491bea05bc0d48060f5f3d
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 +9 -0
- package/dist/index.cjs +6 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -5
- package/dist/{logger-pW8fPrdX.d.ts → logger-tyqDUP6r.d.ts} +1 -1
- package/dist/writers/json.d.cts +1 -1
- package/dist/writers/json.d.ts +1 -1
- package/dist/writers/logtape.d.cts +1 -1
- package/dist/writers/logtape.d.ts +1 -1
- package/dist/writers/pino.d.cts +1 -1
- package/dist/writers/pino.d.ts +1 -1
- package/dist/writers/winston.d.cts +1 -1
- package/dist/writers/winston.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @graphql-hive/logger
|
|
2
2
|
|
|
3
|
+
## 1.1.1-alpha-e92747b9f04aa6ae4f491bea05bc0d48060f5f3d
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#2457](https://github.com/graphql-hive/gateway/pull/2457) [`e92747b`](https://github.com/graphql-hive/gateway/commit/e92747b9f04aa6ae4f491bea05bc0d48060f5f3d) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Circular class instance now resolves to [Circular] instead of recursing forever
|
|
9
|
+
|
|
10
|
+
`objectifyClass` wasn't threading the visited `WeakSet` into its recursive `unwrapAttrVal` calls, so class instances referencing themselves never hit the cycle guard and will then stack overflow.
|
|
11
|
+
|
|
3
12
|
## 1.1.0
|
|
4
13
|
### Minor Changes
|
|
5
14
|
|
package/dist/index.cjs
CHANGED
|
@@ -847,13 +847,13 @@ function unwrapAttrVal(attr, visited = /* @__PURE__ */ new WeakSet()) {
|
|
|
847
847
|
}
|
|
848
848
|
return unwrapped;
|
|
849
849
|
}
|
|
850
|
-
return objectifyClass(attr);
|
|
850
|
+
return objectifyClass(attr, visited);
|
|
851
851
|
}
|
|
852
852
|
function isPrimitive(val) {
|
|
853
853
|
return val !== Object(val);
|
|
854
854
|
}
|
|
855
855
|
const nodejsCustomInspectSy = Symbol.for("nodejs.util.inspect.custom");
|
|
856
|
-
function objectifyClass(val) {
|
|
856
|
+
function objectifyClass(val, visited = /* @__PURE__ */ new WeakSet()) {
|
|
857
857
|
if (
|
|
858
858
|
// simply empty
|
|
859
859
|
!val || // Object.create(null)
|
|
@@ -867,14 +867,15 @@ function objectifyClass(val) {
|
|
|
867
867
|
if (typeof val === "object" && nodejsCustomInspectSy in val && typeof val[nodejsCustomInspectSy] === "function") {
|
|
868
868
|
return {
|
|
869
869
|
[nodejsCustomInspectSy.toString()]: unwrapAttrVal(
|
|
870
|
-
val[nodejsCustomInspectSy](Infinity, {})
|
|
870
|
+
val[nodejsCustomInspectSy](Infinity, {}),
|
|
871
|
+
visited
|
|
871
872
|
),
|
|
872
873
|
class: val.constructor.name
|
|
873
874
|
};
|
|
874
875
|
}
|
|
875
876
|
const props = {};
|
|
876
877
|
for (const propName of Object.getOwnPropertyNames(val)) {
|
|
877
|
-
props[propName] = unwrapAttrVal(val[propName]);
|
|
878
|
+
props[propName] = unwrapAttrVal(val[propName], visited);
|
|
878
879
|
}
|
|
879
880
|
for (const protoPropName of Object.getOwnPropertyNames(
|
|
880
881
|
Object.getPrototypeOf(val)
|
|
@@ -883,7 +884,7 @@ function objectifyClass(val) {
|
|
|
883
884
|
if (typeof propVal === "function") {
|
|
884
885
|
continue;
|
|
885
886
|
}
|
|
886
|
-
props[protoPropName] = unwrapAttrVal(propVal);
|
|
887
|
+
props[protoPropName] = unwrapAttrVal(propVal, visited);
|
|
887
888
|
}
|
|
888
889
|
return {
|
|
889
890
|
...props,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { b as LogWriter, L as LogLevel, a as Attributes, c as Logger } from './logger-tyqDUP6r.js';
|
|
2
|
+
export { A as AttributeValue, d as LoggerOptions, M as MaybeLazy, R as RedactOptions, j as jsonStringify } from './logger-tyqDUP6r.js';
|
|
3
3
|
export { JSONLogWriter } from './writers/json.cjs';
|
|
4
4
|
import '@whatwg-node/disposablestack';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { b as LogWriter, L as LogLevel, a as Attributes, c as Logger } from './logger-tyqDUP6r.js';
|
|
2
|
+
export { A as AttributeValue, d as LoggerOptions, M as MaybeLazy, R as RedactOptions, j as jsonStringify } from './logger-tyqDUP6r.js';
|
|
3
3
|
export { JSONLogWriter } from './writers/json.js';
|
|
4
4
|
import '@whatwg-node/disposablestack';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -845,13 +845,13 @@ function unwrapAttrVal(attr, visited = /* @__PURE__ */ new WeakSet()) {
|
|
|
845
845
|
}
|
|
846
846
|
return unwrapped;
|
|
847
847
|
}
|
|
848
|
-
return objectifyClass(attr);
|
|
848
|
+
return objectifyClass(attr, visited);
|
|
849
849
|
}
|
|
850
850
|
function isPrimitive(val) {
|
|
851
851
|
return val !== Object(val);
|
|
852
852
|
}
|
|
853
853
|
const nodejsCustomInspectSy = Symbol.for("nodejs.util.inspect.custom");
|
|
854
|
-
function objectifyClass(val) {
|
|
854
|
+
function objectifyClass(val, visited = /* @__PURE__ */ new WeakSet()) {
|
|
855
855
|
if (
|
|
856
856
|
// simply empty
|
|
857
857
|
!val || // Object.create(null)
|
|
@@ -865,14 +865,15 @@ function objectifyClass(val) {
|
|
|
865
865
|
if (typeof val === "object" && nodejsCustomInspectSy in val && typeof val[nodejsCustomInspectSy] === "function") {
|
|
866
866
|
return {
|
|
867
867
|
[nodejsCustomInspectSy.toString()]: unwrapAttrVal(
|
|
868
|
-
val[nodejsCustomInspectSy](Infinity, {})
|
|
868
|
+
val[nodejsCustomInspectSy](Infinity, {}),
|
|
869
|
+
visited
|
|
869
870
|
),
|
|
870
871
|
class: val.constructor.name
|
|
871
872
|
};
|
|
872
873
|
}
|
|
873
874
|
const props = {};
|
|
874
875
|
for (const propName of Object.getOwnPropertyNames(val)) {
|
|
875
|
-
props[propName] = unwrapAttrVal(val[propName]);
|
|
876
|
+
props[propName] = unwrapAttrVal(val[propName], visited);
|
|
876
877
|
}
|
|
877
878
|
for (const protoPropName of Object.getOwnPropertyNames(
|
|
878
879
|
Object.getPrototypeOf(val)
|
|
@@ -881,7 +882,7 @@ function objectifyClass(val) {
|
|
|
881
882
|
if (typeof propVal === "function") {
|
|
882
883
|
continue;
|
|
883
884
|
}
|
|
884
|
-
props[protoPropName] = unwrapAttrVal(propVal);
|
|
885
|
+
props[protoPropName] = unwrapAttrVal(propVal, visited);
|
|
885
886
|
}
|
|
886
887
|
return {
|
|
887
888
|
...props,
|
|
@@ -103,4 +103,4 @@ declare class Logger implements AsyncDisposable {
|
|
|
103
103
|
error(attrs: MaybeLazy<Attributes>, msg: string, ...interpol: unknown[]): void;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export { type
|
|
106
|
+
export { type AttributeValue as A, type LogLevel as L, type MaybeLazy as M, type RedactOptions as R, type Attributes as a, type LogWriter as b, Logger as c, type LoggerOptions as d, jsonStringify as j };
|
package/dist/writers/json.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
2
2
|
import '@whatwg-node/disposablestack';
|
|
3
3
|
|
|
4
4
|
declare class JSONLogWriter implements LogWriter {
|
package/dist/writers/json.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
2
2
|
import '@whatwg-node/disposablestack';
|
|
3
3
|
|
|
4
4
|
declare class JSONLogWriter implements LogWriter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLogger } from '@logtape/logtape';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
interface LogTapeLogWriterOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLogger } from '@logtape/logtape';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
interface LogTapeLogWriterOptions {
|
package/dist/writers/pino.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseLogger } from 'pino';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
declare class PinoLogWriter implements LogWriter {
|
package/dist/writers/pino.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseLogger } from 'pino';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
declare class PinoLogWriter implements LogWriter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
declare class WinstonLogWriter implements LogWriter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
|
-
import {
|
|
2
|
+
import { b as LogWriter, L as LogLevel, a as Attributes } from '../logger-tyqDUP6r.js';
|
|
3
3
|
import '@whatwg-node/disposablestack';
|
|
4
4
|
|
|
5
5
|
declare class WinstonLogWriter implements LogWriter {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-hive/logger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1-alpha-e92747b9f04aa6ae4f491bea05bc0d48060f5f3d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"fast-redact": "^3.5.0",
|
|
103
103
|
"fast-safe-stringify": "^2.1.1",
|
|
104
104
|
"pino": "^10.1.0",
|
|
105
|
-
"pkgroll": "2.27.
|
|
105
|
+
"pkgroll": "2.27.1",
|
|
106
106
|
"quick-format-unescaped": "^4.0.4",
|
|
107
107
|
"winston": "^3.18.3"
|
|
108
108
|
},
|