@dxos/client-services 0.1.51-main.04d9478 → 0.1.51-main.0e88376
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/dist/lib/browser/{chunk-QUJROKKU.mjs → chunk-YPN5TDAA.mjs} +17 -47
- package/dist/lib/browser/{chunk-QUJROKKU.mjs.map → chunk-YPN5TDAA.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +34 -64
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +51 -81
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/logging/logging-service.ts +15 -58
|
@@ -3566,8 +3566,7 @@ var DevicesServiceImpl = class {
|
|
|
3566
3566
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
3567
3567
|
import { Event as Event7 } from "@dxos/async";
|
|
3568
3568
|
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
3569
|
-
import {
|
|
3570
|
-
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
3569
|
+
import { log as log14, shouldLog, getContextFromEntry } from "@dxos/log";
|
|
3571
3570
|
import { jsonify } from "@dxos/util";
|
|
3572
3571
|
var LoggingServiceImpl = class {
|
|
3573
3572
|
constructor() {
|
|
@@ -3584,60 +3583,31 @@ var LoggingServiceImpl = class {
|
|
|
3584
3583
|
log14.runtimeConfig.processors.splice(index, 1);
|
|
3585
3584
|
}
|
|
3586
3585
|
queryLogs(request) {
|
|
3586
|
+
var _a;
|
|
3587
|
+
const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
|
|
3587
3588
|
return new Stream11(({ ctx, next }) => {
|
|
3588
3589
|
const handler = (entry2) => {
|
|
3589
|
-
var
|
|
3590
|
-
if (
|
|
3591
|
-
return;
|
|
3592
|
-
}
|
|
3593
|
-
if (((_a = entry2.meta) == null ? void 0 : _a.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
|
|
3594
|
-
return;
|
|
3595
|
-
}
|
|
3596
|
-
if (!shouldLog(entry2, request)) {
|
|
3590
|
+
var _a2, _b, _c;
|
|
3591
|
+
if (((_a2 = entry2.meta) == null ? void 0 : _a2.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
|
|
3597
3592
|
return;
|
|
3598
3593
|
}
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
line: (_e = (_d = entry2.meta) == null ? void 0 : _d.line) != null ? _e : 0
|
|
3607
|
-
}
|
|
3608
|
-
};
|
|
3609
|
-
try {
|
|
3610
|
-
LOG_PROCESSING++;
|
|
3594
|
+
if (shouldLog(entry2, filters)) {
|
|
3595
|
+
const record = {
|
|
3596
|
+
...entry2,
|
|
3597
|
+
context: jsonify(getContextFromEntry(entry2))
|
|
3598
|
+
};
|
|
3599
|
+
(_b = record.meta) == null ? true : delete _b.bugcheck;
|
|
3600
|
+
(_c = record.meta) == null ? true : delete _c.scope;
|
|
3611
3601
|
next(record);
|
|
3612
|
-
} finally {
|
|
3613
|
-
LOG_PROCESSING--;
|
|
3614
3602
|
}
|
|
3615
3603
|
};
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
var matchFilter = (filter, level, path, options) => {
|
|
3621
|
-
switch (options) {
|
|
3622
|
-
case QueryLogsRequest.MatchingOptions.INCLUSIVE:
|
|
3623
|
-
return level >= filter.level && (!filter.pattern || path.includes(filter.pattern));
|
|
3624
|
-
case QueryLogsRequest.MatchingOptions.EXPLICIT:
|
|
3625
|
-
return level === filter.level && (!filter.pattern || path.includes(filter.pattern));
|
|
3626
|
-
}
|
|
3627
|
-
};
|
|
3628
|
-
var shouldLog = (entry2, request) => {
|
|
3629
|
-
var _a;
|
|
3630
|
-
const options = (_a = request.options) != null ? _a : QueryLogsRequest.MatchingOptions.INCLUSIVE;
|
|
3631
|
-
if (request.filters === void 0) {
|
|
3632
|
-
return options === QueryLogsRequest.MatchingOptions.INCLUSIVE;
|
|
3633
|
-
} else {
|
|
3634
|
-
return request.filters.some((filter) => {
|
|
3635
|
-
var _a2, _b;
|
|
3636
|
-
return matchFilter(filter, entry2.level, (_b = (_a2 = entry2.meta) == null ? void 0 : _a2.file) != null ? _b : "", options);
|
|
3604
|
+
ctx.onDispose(() => {
|
|
3605
|
+
this._logs.off(handler);
|
|
3606
|
+
});
|
|
3607
|
+
this._logs.on(handler);
|
|
3637
3608
|
});
|
|
3638
3609
|
}
|
|
3639
3610
|
};
|
|
3640
|
-
var LOG_PROCESSING = 0;
|
|
3641
3611
|
|
|
3642
3612
|
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
3643
3613
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
@@ -3994,4 +3964,4 @@ export {
|
|
|
3994
3964
|
ClientServicesHost,
|
|
3995
3965
|
LocalClientServices
|
|
3996
3966
|
};
|
|
3997
|
-
//# sourceMappingURL=chunk-
|
|
3967
|
+
//# sourceMappingURL=chunk-YPN5TDAA.mjs.map
|