@eventuras/logger 0.7.0 → 0.7.1
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/LICENSE +674 -0
- package/dist/{esm-wJpbN37y.js → esm-CIhYjsQQ.js} +1 -1
- package/dist/index.js +39 -418
- package/dist/node.js +1 -1
- package/dist/opentelemetry.js +1 -1
- package/dist/{pretty-BTJ0fKhV.js → pretty-sMlW_evX.js} +38 -38
- package/dist/{src-V4zpQbfq.js → src-15l0SmY8.js} +101 -100
- package/package.json +11 -11
- package/dist/__vite-browser-external-pQ4XsTOI.js +0 -7
- /package/dist/{esm-B1-Y8LUx.js → esm-Dido2CZe.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,410 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
//#region
|
|
4
|
-
var
|
|
5
|
-
function n(e) {
|
|
6
|
-
try {
|
|
7
|
-
return JSON.stringify(e);
|
|
8
|
-
} catch {
|
|
9
|
-
return "\"[Circular]\"";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
t.exports = r;
|
|
13
|
-
function r(e, t, r) {
|
|
14
|
-
var i = r && r.stringify || n, a = 1;
|
|
15
|
-
if (typeof e == "object" && e) {
|
|
16
|
-
var o = t.length + a;
|
|
17
|
-
if (o === 1) return e;
|
|
18
|
-
var s = Array(o);
|
|
19
|
-
s[0] = i(e);
|
|
20
|
-
for (var c = 1; c < o; c++) s[c] = i(t[c]);
|
|
21
|
-
return s.join(" ");
|
|
22
|
-
}
|
|
23
|
-
if (typeof e != "string") return e;
|
|
24
|
-
var l = t.length;
|
|
25
|
-
if (l === 0) return e;
|
|
26
|
-
for (var u = "", d = 1 - a, f = -1, p = e && e.length || 0, m = 0; m < p;) {
|
|
27
|
-
if (e.charCodeAt(m) === 37 && m + 1 < p) {
|
|
28
|
-
switch (f = f > -1 ? f : 0, e.charCodeAt(m + 1)) {
|
|
29
|
-
case 100:
|
|
30
|
-
case 102:
|
|
31
|
-
if (d >= l || t[d] == null) break;
|
|
32
|
-
f < m && (u += e.slice(f, m)), u += Number(t[d]), f = m + 2, m++;
|
|
33
|
-
break;
|
|
34
|
-
case 105:
|
|
35
|
-
if (d >= l || t[d] == null) break;
|
|
36
|
-
f < m && (u += e.slice(f, m)), u += Math.floor(Number(t[d])), f = m + 2, m++;
|
|
37
|
-
break;
|
|
38
|
-
case 79:
|
|
39
|
-
case 111:
|
|
40
|
-
case 106:
|
|
41
|
-
if (d >= l || t[d] === void 0) break;
|
|
42
|
-
f < m && (u += e.slice(f, m));
|
|
43
|
-
var h = typeof t[d];
|
|
44
|
-
if (h === "string") {
|
|
45
|
-
u += "'" + t[d] + "'", f = m + 2, m++;
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
if (h === "function") {
|
|
49
|
-
u += t[d].name || "<anonymous>", f = m + 2, m++;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
u += i(t[d]), f = m + 2, m++;
|
|
53
|
-
break;
|
|
54
|
-
case 115:
|
|
55
|
-
if (d >= l) break;
|
|
56
|
-
f < m && (u += e.slice(f, m)), u += String(t[d]), f = m + 2, m++;
|
|
57
|
-
break;
|
|
58
|
-
case 37:
|
|
59
|
-
f < m && (u += e.slice(f, m)), u += "%", f = m + 2, m++, d--;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
++d;
|
|
63
|
-
}
|
|
64
|
-
++m;
|
|
65
|
-
}
|
|
66
|
-
return f === -1 ? e : (f < p && (u += e.slice(f)), u);
|
|
67
|
-
}
|
|
68
|
-
})), i = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
69
|
-
var n = r();
|
|
70
|
-
t.exports = p;
|
|
71
|
-
var i = N().console || {}, a = {
|
|
72
|
-
mapHttpRequest: E,
|
|
73
|
-
mapHttpResponse: E,
|
|
74
|
-
wrapRequestSerializer: D,
|
|
75
|
-
wrapResponseSerializer: D,
|
|
76
|
-
wrapErrorSerializer: D,
|
|
77
|
-
req: E,
|
|
78
|
-
res: E,
|
|
79
|
-
err: w,
|
|
80
|
-
errWithCause: w
|
|
81
|
-
};
|
|
82
|
-
function o(e, t) {
|
|
83
|
-
return e === "silent" ? Infinity : t.levels.values[e];
|
|
84
|
-
}
|
|
85
|
-
var s = Symbol("pino.logFuncs"), c = Symbol("pino.hierarchy"), l = {
|
|
86
|
-
error: "log",
|
|
87
|
-
fatal: "error",
|
|
88
|
-
warn: "error",
|
|
89
|
-
info: "log",
|
|
90
|
-
debug: "log",
|
|
91
|
-
trace: "log"
|
|
92
|
-
};
|
|
93
|
-
function u(e, t) {
|
|
94
|
-
t[c] = {
|
|
95
|
-
logger: t,
|
|
96
|
-
parent: e[c]
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function d(e, t, n) {
|
|
100
|
-
let r = {};
|
|
101
|
-
t.forEach((e) => {
|
|
102
|
-
r[e] = n[e] ? n[e] : i[e] || i[l[e] || "log"] || O;
|
|
103
|
-
}), e[s] = r;
|
|
104
|
-
}
|
|
105
|
-
function f(e, t) {
|
|
106
|
-
return Array.isArray(e) ? e.filter(function(e) {
|
|
107
|
-
return e !== "!stdSerializers.err";
|
|
108
|
-
}) : e === !0 ? Object.keys(t) : !1;
|
|
109
|
-
}
|
|
110
|
-
function p(e) {
|
|
111
|
-
e ||= {}, e.browser = e.browser || {};
|
|
112
|
-
let t = e.browser.transmit;
|
|
113
|
-
if (t && typeof t.send != "function") throw Error("pino: transmit option must have a send function");
|
|
114
|
-
let n = e.browser.write || i;
|
|
115
|
-
e.browser.write && (e.browser.asObject = !0);
|
|
116
|
-
let r = e.serializers || {}, a = f(e.browser.serialize, r), s = e.browser.serialize;
|
|
117
|
-
Array.isArray(e.browser.serialize) && e.browser.serialize.indexOf("!stdSerializers.err") > -1 && (s = !1);
|
|
118
|
-
let c = Object.keys(e.customLevels || {}), l = [
|
|
119
|
-
"error",
|
|
120
|
-
"fatal",
|
|
121
|
-
"warn",
|
|
122
|
-
"info",
|
|
123
|
-
"debug",
|
|
124
|
-
"trace"
|
|
125
|
-
].concat(c);
|
|
126
|
-
typeof n == "function" && l.forEach(function(e) {
|
|
127
|
-
n[e] = n;
|
|
128
|
-
}), (e.enabled === !1 || e.browser.disabled) && (e.level = "silent");
|
|
129
|
-
let p = e.level || "info", h = Object.create(n);
|
|
130
|
-
h.log ||= O, d(h, l, n), u({}, h), Object.defineProperty(h, "levelVal", { get: v }), Object.defineProperty(h, "level", {
|
|
131
|
-
get: y,
|
|
132
|
-
set: b
|
|
133
|
-
});
|
|
134
|
-
let g = {
|
|
135
|
-
transmit: t,
|
|
136
|
-
serialize: a,
|
|
137
|
-
asObject: e.browser.asObject,
|
|
138
|
-
asObjectBindingsOnly: e.browser.asObjectBindingsOnly,
|
|
139
|
-
formatters: e.browser.formatters,
|
|
140
|
-
reportCaller: e.browser.reportCaller,
|
|
141
|
-
levels: l,
|
|
142
|
-
timestamp: T(e),
|
|
143
|
-
messageKey: e.messageKey || "msg",
|
|
144
|
-
onChild: e.onChild || O
|
|
145
|
-
};
|
|
146
|
-
h.levels = m(e), h.level = p, h.isLevelEnabled = function(e) {
|
|
147
|
-
return this.levels.values[e] ? this.levels.values[e] >= this.levels.values[this.level] : !1;
|
|
148
|
-
}, h.setMaxListeners = h.getMaxListeners = h.emit = h.addListener = h.on = h.prependListener = h.once = h.prependOnceListener = h.removeListener = h.removeAllListeners = h.listeners = h.listenerCount = h.eventNames = h.write = h.flush = O, h.serializers = r, h._serialize = a, h._stdErrSerialize = s, h.child = function(...e) {
|
|
149
|
-
return S.call(this, g, ...e);
|
|
150
|
-
}, t && (h._logEvent = C());
|
|
151
|
-
function v() {
|
|
152
|
-
return o(this.level, this);
|
|
153
|
-
}
|
|
154
|
-
function y() {
|
|
155
|
-
return this._level;
|
|
156
|
-
}
|
|
157
|
-
function b(e) {
|
|
158
|
-
if (e !== "silent" && !this.levels.values[e]) throw Error("unknown level " + e);
|
|
159
|
-
this._level = e, _(this, g, h, "error"), _(this, g, h, "fatal"), _(this, g, h, "warn"), _(this, g, h, "info"), _(this, g, h, "debug"), _(this, g, h, "trace"), c.forEach((e) => {
|
|
160
|
-
_(this, g, h, e);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
function S(n, i, o) {
|
|
164
|
-
if (!i) throw Error("missing bindings for child Pino");
|
|
165
|
-
o ||= {}, a && i.serializers && (o.serializers = i.serializers);
|
|
166
|
-
let s = o.serializers;
|
|
167
|
-
if (a && s) {
|
|
168
|
-
var c = Object.assign({}, r, s), l = e.browser.serialize === !0 ? Object.keys(c) : a;
|
|
169
|
-
delete i.serializers, x([i], l, c, this._stdErrSerialize);
|
|
170
|
-
}
|
|
171
|
-
function d(e) {
|
|
172
|
-
this._childLevel = (e._childLevel | 0) + 1, this.bindings = i, c && (this.serializers = c, this._serialize = l), t && (this._logEvent = C([].concat(e._logEvent.bindings, i)));
|
|
173
|
-
}
|
|
174
|
-
d.prototype = this;
|
|
175
|
-
let f = new d(this);
|
|
176
|
-
return u(this, f), f.child = function(...e) {
|
|
177
|
-
return S.call(this, n, ...e);
|
|
178
|
-
}, f.level = o.level || this.level, n.onChild(f), f;
|
|
179
|
-
}
|
|
180
|
-
return h;
|
|
181
|
-
}
|
|
182
|
-
function m(e) {
|
|
183
|
-
let t = e.customLevels || {};
|
|
184
|
-
return {
|
|
185
|
-
values: Object.assign({}, p.levels.values, t),
|
|
186
|
-
labels: Object.assign({}, p.levels.labels, h(t))
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
function h(e) {
|
|
190
|
-
let t = {};
|
|
191
|
-
return Object.keys(e).forEach(function(n) {
|
|
192
|
-
t[e[n]] = n;
|
|
193
|
-
}), t;
|
|
194
|
-
}
|
|
195
|
-
p.levels = {
|
|
196
|
-
values: {
|
|
197
|
-
fatal: 60,
|
|
198
|
-
error: 50,
|
|
199
|
-
warn: 40,
|
|
200
|
-
info: 30,
|
|
201
|
-
debug: 20,
|
|
202
|
-
trace: 10
|
|
203
|
-
},
|
|
204
|
-
labels: {
|
|
205
|
-
10: "trace",
|
|
206
|
-
20: "debug",
|
|
207
|
-
30: "info",
|
|
208
|
-
40: "warn",
|
|
209
|
-
50: "error",
|
|
210
|
-
60: "fatal"
|
|
211
|
-
}
|
|
212
|
-
}, p.stdSerializers = a, p.stdTimeFunctions = Object.assign({}, {
|
|
213
|
-
nullTime: k,
|
|
214
|
-
epochTime: A,
|
|
215
|
-
unixTime: j,
|
|
216
|
-
isoTime: M
|
|
217
|
-
});
|
|
218
|
-
function g(e) {
|
|
219
|
-
let t = [];
|
|
220
|
-
e.bindings && t.push(e.bindings);
|
|
221
|
-
let n = e[c];
|
|
222
|
-
for (; n.parent;) n = n.parent, n.logger.bindings && t.push(n.logger.bindings);
|
|
223
|
-
return t.reverse();
|
|
224
|
-
}
|
|
225
|
-
function _(e, t, n, r) {
|
|
226
|
-
if (Object.defineProperty(e, r, {
|
|
227
|
-
value: o(e.level, n) > o(r, n) ? O : n[s][r],
|
|
228
|
-
writable: !0,
|
|
229
|
-
enumerable: !0,
|
|
230
|
-
configurable: !0
|
|
231
|
-
}), e[r] === O) {
|
|
232
|
-
if (!t.transmit) return;
|
|
233
|
-
let i = o(t.transmit.level || e.level, n);
|
|
234
|
-
if (o(r, n) < i) return;
|
|
235
|
-
}
|
|
236
|
-
e[r] = y(e, t, n, r);
|
|
237
|
-
let i = g(e);
|
|
238
|
-
i.length !== 0 && (e[r] = v(i, e[r]));
|
|
239
|
-
}
|
|
240
|
-
function v(e, t) {
|
|
241
|
-
return function() {
|
|
242
|
-
return t.apply(this, [...e, ...arguments]);
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
function y(e, t, n, r) {
|
|
246
|
-
return (function(a) {
|
|
247
|
-
return function() {
|
|
248
|
-
let s = t.timestamp(), c = Array(arguments.length), l = Object.getPrototypeOf && Object.getPrototypeOf(this) === i ? i : this;
|
|
249
|
-
for (var u = 0; u < c.length; u++) c[u] = arguments[u];
|
|
250
|
-
var d = !1;
|
|
251
|
-
if (t.serialize && (x(c, this._serialize, this.serializers, this._stdErrSerialize), d = !0), t.asObject || t.formatters) {
|
|
252
|
-
let e = b(this, r, c, s, t);
|
|
253
|
-
if (t.reportCaller && e && e.length > 0 && e[0] && typeof e[0] == "object") try {
|
|
254
|
-
let t = P();
|
|
255
|
-
t && (e[0].caller = t);
|
|
256
|
-
} catch {}
|
|
257
|
-
a.call(l, ...e);
|
|
258
|
-
} else {
|
|
259
|
-
if (t.reportCaller) try {
|
|
260
|
-
let e = P();
|
|
261
|
-
e && c.push(e);
|
|
262
|
-
} catch {}
|
|
263
|
-
a.apply(l, c);
|
|
264
|
-
}
|
|
265
|
-
if (t.transmit) {
|
|
266
|
-
let i = t.transmit.level || e._level, a = o(i, n), l = o(r, n);
|
|
267
|
-
if (l < a) return;
|
|
268
|
-
S(this, {
|
|
269
|
-
ts: s,
|
|
270
|
-
methodLevel: r,
|
|
271
|
-
methodValue: l,
|
|
272
|
-
transmitLevel: i,
|
|
273
|
-
transmitValue: n.levels.values[t.transmit.level || e._level],
|
|
274
|
-
send: t.transmit.send,
|
|
275
|
-
val: o(e._level, n)
|
|
276
|
-
}, c, d);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
})(e[s][r]);
|
|
280
|
-
}
|
|
281
|
-
function b(e, t, r, i, a) {
|
|
282
|
-
let { level: o, log: s = (e) => e } = a.formatters || {}, c = r.slice(), l = c[0], u = {}, d = (e._childLevel | 0) + 1;
|
|
283
|
-
if (d < 1 && (d = 1), i && (u.time = i), o) {
|
|
284
|
-
let n = o(t, e.levels.values[t]);
|
|
285
|
-
Object.assign(u, n);
|
|
286
|
-
} else u.level = e.levels.values[t];
|
|
287
|
-
if (a.asObjectBindingsOnly) {
|
|
288
|
-
if (typeof l == "object" && l) for (; d-- && typeof c[0] == "object";) Object.assign(u, c.shift());
|
|
289
|
-
return [s(u), ...c];
|
|
290
|
-
} else {
|
|
291
|
-
if (typeof l == "object" && l) {
|
|
292
|
-
for (; d-- && typeof c[0] == "object";) Object.assign(u, c.shift());
|
|
293
|
-
l = c.length ? n(c.shift(), c) : void 0;
|
|
294
|
-
} else typeof l == "string" && (l = n(c.shift(), c));
|
|
295
|
-
return l !== void 0 && (u[a.messageKey] = l), [s(u)];
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function x(e, t, n, r) {
|
|
299
|
-
for (let i in e) if (r && e[i] instanceof Error) e[i] = p.stdSerializers.err(e[i]);
|
|
300
|
-
else if (typeof e[i] == "object" && !Array.isArray(e[i]) && t) for (let r in e[i]) t.indexOf(r) > -1 && r in n && (e[i][r] = n[r](e[i][r]));
|
|
301
|
-
}
|
|
302
|
-
function S(e, t, n, r = !1) {
|
|
303
|
-
let i = t.send, a = t.ts, o = t.methodLevel, s = t.methodValue, c = t.val, l = e._logEvent.bindings;
|
|
304
|
-
r || x(n, e._serialize || Object.keys(e.serializers), e.serializers, e._stdErrSerialize === void 0 ? !0 : e._stdErrSerialize), e._logEvent.ts = a, e._logEvent.messages = n.filter(function(e) {
|
|
305
|
-
return l.indexOf(e) === -1;
|
|
306
|
-
}), e._logEvent.level.label = o, e._logEvent.level.value = s, i(o, e._logEvent, c), e._logEvent = C(l);
|
|
307
|
-
}
|
|
308
|
-
function C(e) {
|
|
309
|
-
return {
|
|
310
|
-
ts: 0,
|
|
311
|
-
messages: [],
|
|
312
|
-
bindings: e || [],
|
|
313
|
-
level: {
|
|
314
|
-
label: "",
|
|
315
|
-
value: 0
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function w(e) {
|
|
320
|
-
let t = {
|
|
321
|
-
type: e.constructor.name,
|
|
322
|
-
msg: e.message,
|
|
323
|
-
stack: e.stack
|
|
324
|
-
};
|
|
325
|
-
for (let n in e) t[n] === void 0 && (t[n] = e[n]);
|
|
326
|
-
return t;
|
|
327
|
-
}
|
|
328
|
-
function T(e) {
|
|
329
|
-
return typeof e.timestamp == "function" ? e.timestamp : e.timestamp === !1 ? k : A;
|
|
330
|
-
}
|
|
331
|
-
function E() {
|
|
332
|
-
return {};
|
|
333
|
-
}
|
|
334
|
-
function D(e) {
|
|
335
|
-
return e;
|
|
336
|
-
}
|
|
337
|
-
function O() {}
|
|
338
|
-
function k() {
|
|
339
|
-
return !1;
|
|
340
|
-
}
|
|
341
|
-
function A() {
|
|
342
|
-
return Date.now();
|
|
343
|
-
}
|
|
344
|
-
function j() {
|
|
345
|
-
return Math.round(Date.now() / 1e3);
|
|
346
|
-
}
|
|
347
|
-
function M() {
|
|
348
|
-
return new Date(Date.now()).toISOString();
|
|
349
|
-
}
|
|
350
|
-
/* istanbul ignore next */
|
|
351
|
-
function N() {
|
|
352
|
-
function e(e) {
|
|
353
|
-
return e !== void 0 && e;
|
|
354
|
-
}
|
|
355
|
-
try {
|
|
356
|
-
return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", {
|
|
357
|
-
get: function() {
|
|
358
|
-
return delete Object.prototype.globalThis, this.globalThis = this;
|
|
359
|
-
},
|
|
360
|
-
configurable: !0
|
|
361
|
-
}), globalThis;
|
|
362
|
-
} catch {
|
|
363
|
-
return e(self) || e(window) || e(this) || {};
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
t.exports.default = p, t.exports.pino = p;
|
|
367
|
-
/* istanbul ignore next */
|
|
368
|
-
function P() {
|
|
369
|
-
let e = (/* @__PURE__ */ Error()).stack;
|
|
370
|
-
if (!e) return null;
|
|
371
|
-
let t = e.split("\n");
|
|
372
|
-
for (let e = 1; e < t.length; e++) {
|
|
373
|
-
let n = t[e].trim();
|
|
374
|
-
if (/(^at\s+)?(createWrap|LOG|set\s*\(|asObject|Object\.apply|Function\.apply)/.test(n) || n.indexOf("browser.js") !== -1 || n.indexOf("node:internal") !== -1 || n.indexOf("node_modules") !== -1) continue;
|
|
375
|
-
let r = n.match(/\((.*?):(\d+):(\d+)\)/);
|
|
376
|
-
if (r ||= n.match(/at\s+(.*?):(\d+):(\d+)/), r) {
|
|
377
|
-
let e = r[1], t = r[2], n = r[3];
|
|
378
|
-
return e + ":" + t + ":" + n;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
return null;
|
|
382
|
-
}
|
|
383
|
-
})))(), 1), a = class {
|
|
1
|
+
import { t as e } from "./pretty-sMlW_evX.js";
|
|
2
|
+
import t from "pino";
|
|
3
|
+
//#region src/transports/pino.ts
|
|
4
|
+
var n = class {
|
|
384
5
|
pino;
|
|
385
|
-
constructor(
|
|
386
|
-
let
|
|
387
|
-
level:
|
|
388
|
-
timestamp:
|
|
6
|
+
constructor(n = {}) {
|
|
7
|
+
let r = {
|
|
8
|
+
level: n.level ?? "info",
|
|
9
|
+
timestamp: t.stdTimeFunctions.isoTime,
|
|
389
10
|
formatters: { level: (e) => ({ level: e }) },
|
|
390
|
-
...
|
|
391
|
-
paths:
|
|
11
|
+
...n.redact && { redact: {
|
|
12
|
+
paths: n.redact,
|
|
392
13
|
censor: "[REDACTED]"
|
|
393
14
|
} },
|
|
394
|
-
...
|
|
15
|
+
...n.pinoOptions
|
|
395
16
|
};
|
|
396
|
-
|
|
17
|
+
n.prettyPrint ? this.pino = t(r, e()) : n.destination ? this.pino = t(r, t.destination(n.destination)) : this.pino = t(r);
|
|
397
18
|
}
|
|
398
19
|
log(e, t, n) {
|
|
399
20
|
n ? this.pino[e](t, n) : this.pino[e](t);
|
|
400
21
|
}
|
|
401
22
|
child(e) {
|
|
402
|
-
return new
|
|
23
|
+
return new r(this.pino.child(e));
|
|
403
24
|
}
|
|
404
25
|
async flush() {
|
|
405
26
|
this.pino.flush();
|
|
406
27
|
}
|
|
407
|
-
},
|
|
28
|
+
}, r = class e {
|
|
408
29
|
constructor(e) {
|
|
409
30
|
this.pinoChild = e;
|
|
410
31
|
}
|
|
@@ -417,24 +38,24 @@ var r = /* @__PURE__ */ t(((e, t) => {
|
|
|
417
38
|
async flush() {
|
|
418
39
|
this.pinoChild.flush();
|
|
419
40
|
}
|
|
420
|
-
},
|
|
41
|
+
}, i = {
|
|
421
42
|
trace: "debug",
|
|
422
43
|
debug: "debug",
|
|
423
44
|
info: "log",
|
|
424
45
|
warn: "warn",
|
|
425
46
|
error: "error",
|
|
426
47
|
fatal: "error"
|
|
427
|
-
},
|
|
48
|
+
}, a = class e {
|
|
428
49
|
bindings;
|
|
429
50
|
constructor(e) {
|
|
430
51
|
this.bindings = e ?? {};
|
|
431
52
|
}
|
|
432
53
|
log(e, t, n) {
|
|
433
|
-
let r =
|
|
54
|
+
let r = i[e], a = {
|
|
434
55
|
...this.bindings,
|
|
435
56
|
...t
|
|
436
|
-
},
|
|
437
|
-
n &&
|
|
57
|
+
}, o = Object.keys(a).length > 0;
|
|
58
|
+
n && o ? console[r](`[${e}]`, n, a) : n ? console[r](`[${e}]`, n) : o && console[r](`[${e}]`, a);
|
|
438
59
|
}
|
|
439
60
|
child(t) {
|
|
440
61
|
return new e({
|
|
@@ -442,38 +63,38 @@ var r = /* @__PURE__ */ t(((e, t) => {
|
|
|
442
63
|
...t
|
|
443
64
|
});
|
|
444
65
|
}
|
|
445
|
-
},
|
|
66
|
+
}, o = [
|
|
446
67
|
"password",
|
|
447
68
|
"token",
|
|
448
69
|
"apiKey",
|
|
449
70
|
"authorization",
|
|
450
71
|
"secret"
|
|
451
72
|
];
|
|
452
|
-
function
|
|
73
|
+
function s(e) {
|
|
453
74
|
if (typeof globalThis < "u" && typeof globalThis.process == "object") return globalThis.process.env[e];
|
|
454
75
|
}
|
|
455
|
-
function
|
|
76
|
+
function c() {
|
|
456
77
|
try {
|
|
457
78
|
return typeof process < "u" && typeof process.versions?.node == "string";
|
|
458
79
|
} catch {
|
|
459
80
|
return !1;
|
|
460
81
|
}
|
|
461
82
|
}
|
|
462
|
-
function
|
|
463
|
-
return
|
|
464
|
-
level: e.level ??
|
|
465
|
-
redact: e.redact ??
|
|
466
|
-
prettyPrint: e.prettyPrint ??
|
|
83
|
+
function l(e) {
|
|
84
|
+
return c() ? new n({
|
|
85
|
+
level: e.level ?? s("LOG_LEVEL") ?? "info",
|
|
86
|
+
redact: e.redact ?? o,
|
|
87
|
+
prettyPrint: e.prettyPrint ?? s("NODE_ENV") === "development",
|
|
467
88
|
destination: e.destination
|
|
468
|
-
}) : new
|
|
89
|
+
}) : new a();
|
|
469
90
|
}
|
|
470
|
-
var
|
|
91
|
+
var u = class e {
|
|
471
92
|
static transport;
|
|
472
93
|
static config = {};
|
|
473
94
|
options;
|
|
474
95
|
childTransport;
|
|
475
96
|
static {
|
|
476
|
-
e.transport =
|
|
97
|
+
e.transport = l(e.config);
|
|
477
98
|
}
|
|
478
99
|
constructor(t = {}) {
|
|
479
100
|
if (this.options = t, t.context || t.correlationId || t.namespace) {
|
|
@@ -489,20 +110,20 @@ var p = class e {
|
|
|
489
110
|
e.config = {
|
|
490
111
|
...e.config,
|
|
491
112
|
...t
|
|
492
|
-
}, e.transport = e.config.transport ??
|
|
113
|
+
}, e.transport = e.config.transport ?? l(e.config), e.rebindStaticMethods();
|
|
493
114
|
}
|
|
494
115
|
static getTransport() {
|
|
495
116
|
return e.transport;
|
|
496
117
|
}
|
|
497
118
|
static getPinoInstance() {
|
|
498
|
-
if (e.transport instanceof
|
|
119
|
+
if (e.transport instanceof n) return e.transport.pino;
|
|
499
120
|
throw Error("getPinoInstance() requires PinoTransport. Use Logger.getTransport() for the active transport.");
|
|
500
121
|
}
|
|
501
122
|
static normalizeArgs(e, t) {
|
|
502
123
|
return typeof e == "string" ? [{}, [e, ...t]] : [e, t];
|
|
503
124
|
}
|
|
504
125
|
static isDevelopment() {
|
|
505
|
-
return
|
|
126
|
+
return s("NODE_ENV") === "development";
|
|
506
127
|
}
|
|
507
128
|
static formatError(e) {
|
|
508
129
|
return e instanceof Error ? `${e.name}: ${e.message}\nStack: ${e.stack}` : String(e);
|
|
@@ -585,7 +206,7 @@ var p = class e {
|
|
|
585
206
|
let r = this.childTransport ?? e.transport;
|
|
586
207
|
typeof t == "string" ? r.log("fatal", {}, t) : t instanceof Error ? r.log("fatal", { error: t }, n) : n ? r.log("fatal", t ?? {}, n) : r.log("fatal", t ?? {});
|
|
587
208
|
}
|
|
588
|
-
},
|
|
209
|
+
}, d = [
|
|
589
210
|
"authorization",
|
|
590
211
|
"cookie",
|
|
591
212
|
"set-cookie",
|
|
@@ -593,15 +214,15 @@ var p = class e {
|
|
|
593
214
|
"x-auth-token",
|
|
594
215
|
"proxy-authorization"
|
|
595
216
|
];
|
|
596
|
-
function
|
|
217
|
+
function f(e) {
|
|
597
218
|
let t = {};
|
|
598
219
|
return e instanceof Headers ? e.forEach((e, n) => {
|
|
599
|
-
t[n] =
|
|
220
|
+
t[n] = d.includes(n.toLowerCase()) ? "[REDACTED]" : e;
|
|
600
221
|
}) : Array.isArray(e) ? e.forEach(([e, n]) => {
|
|
601
|
-
t[e] =
|
|
222
|
+
t[e] = d.includes(e.toLowerCase()) ? "[REDACTED]" : String(n);
|
|
602
223
|
}) : Object.entries(e).forEach(([e, n]) => {
|
|
603
|
-
t[e] =
|
|
224
|
+
t[e] = d.includes(e.toLowerCase()) ? "[REDACTED]" : String(n);
|
|
604
225
|
}), t;
|
|
605
226
|
}
|
|
606
227
|
//#endregion
|
|
607
|
-
export {
|
|
228
|
+
export { a as ConsoleTransport, u as Logger, n as PinoTransport, f as redactHeaders };
|
package/dist/node.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./pretty-
|
|
1
|
+
import { n as e, t } from "./pretty-sMlW_evX.js";
|
|
2
2
|
export { t as createPrettyStream, e as formatLogLine };
|
package/dist/opentelemetry.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as e } from "./chunk-NnHqS4_Y.js";
|
|
|
2
2
|
//#region src/opentelemetry.ts
|
|
3
3
|
async function t() {
|
|
4
4
|
try {
|
|
5
|
-
let [t, n] = await Promise.all([import("./src-
|
|
5
|
+
let [t, n] = await Promise.all([import("./src-15l0SmY8.js").then((t) => /* @__PURE__ */ e(t.default, 1)), import("./esm-CIhYjsQQ.js")]);
|
|
6
6
|
return {
|
|
7
7
|
PinoInstrumentation: t.PinoInstrumentation,
|
|
8
8
|
LoggerProvider: n.LoggerProvider
|