@agoric/cosmic-swingset 0.41.4-dev-fa6d3d3.0.fa6d3d3 → 0.41.4-dev-433c8e8.0.433c8e8
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/package.json +12 -13
- package/src/anylogger-agoric.js +29 -10
- package/src/entrypoint.js +1 -1
- package/src/launch-chain.js +1 -1
- package/src/sim-chain.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmic-swingset",
|
|
3
|
-
"version": "0.41.4-dev-
|
|
3
|
+
"version": "0.41.4-dev-433c8e8.0.433c8e8",
|
|
4
4
|
"description": "Agoric's Cosmos blockchain integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/builders": "0.1.1-dev-
|
|
26
|
-
"@agoric/cosmos": "0.34.2-dev-
|
|
27
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
28
|
-
"@agoric/internal": "0.3.3-dev-
|
|
29
|
-
"@agoric/store": "0.9.3-dev-
|
|
30
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
31
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
32
|
-
"@agoric/telemetry": "0.6.3-dev-
|
|
33
|
-
"@agoric/vm-config": "0.1.1-dev-
|
|
25
|
+
"@agoric/builders": "0.1.1-dev-433c8e8.0.433c8e8",
|
|
26
|
+
"@agoric/cosmos": "0.34.2-dev-433c8e8.0.433c8e8",
|
|
27
|
+
"@agoric/deploy-script-support": "0.10.4-dev-433c8e8.0.433c8e8",
|
|
28
|
+
"@agoric/internal": "0.3.3-dev-433c8e8.0.433c8e8",
|
|
29
|
+
"@agoric/store": "0.9.3-dev-433c8e8.0.433c8e8",
|
|
30
|
+
"@agoric/swing-store": "0.9.2-dev-433c8e8.0.433c8e8",
|
|
31
|
+
"@agoric/swingset-vat": "0.32.3-dev-433c8e8.0.433c8e8",
|
|
32
|
+
"@agoric/telemetry": "0.6.3-dev-433c8e8.0.433c8e8",
|
|
33
|
+
"@agoric/vm-config": "0.1.1-dev-433c8e8.0.433c8e8",
|
|
34
34
|
"@endo/bundle-source": "^4.1.2",
|
|
35
35
|
"@endo/env-options": "^1.1.11",
|
|
36
36
|
"@endo/errors": "^1.2.13",
|
|
@@ -45,14 +45,13 @@
|
|
|
45
45
|
"@iarna/toml": "^2.2.3",
|
|
46
46
|
"@opentelemetry/api": "~1.9.0",
|
|
47
47
|
"@opentelemetry/sdk-metrics": "~1.30.1",
|
|
48
|
-
"anylogger": "^0.21.0",
|
|
49
48
|
"deterministic-json": "^1.0.5",
|
|
50
49
|
"import-meta-resolve": "^4.1.0",
|
|
51
50
|
"ses": "^1.14.0",
|
|
52
51
|
"tmp": "^0.2.1"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
54
|
+
"@agoric/kmarshal": "0.1.1-dev-433c8e8.0.433c8e8",
|
|
56
55
|
"ava": "^6.4.1",
|
|
57
56
|
"better-sqlite3": "^10.1.0",
|
|
58
57
|
"c8": "^10.1.3",
|
|
@@ -88,5 +87,5 @@
|
|
|
88
87
|
"typeCoverage": {
|
|
89
88
|
"atLeast": 86.49
|
|
90
89
|
},
|
|
91
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "433c8e8aa635325e306429914607df40e7812ee6"
|
|
92
91
|
}
|
package/src/anylogger-agoric.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file cosmic-swingset anylogger adapter.
|
|
3
|
+
*
|
|
4
|
+
* Use this module for cosmic-swingset/runtime logging, where output is consumed
|
|
5
|
+
* as service logs rather than interactive CLI output.
|
|
6
|
+
*
|
|
7
|
+
* Runtime-focused behavior:
|
|
8
|
+
* - Reads `DEBUG` selectors (`agoric`, `agoric:<level>`, `agoric:none`).
|
|
9
|
+
* - Adds ISO timestamps and stable labels to emitted messages.
|
|
10
|
+
* - Suppresses high-volume vat/liveslots logs unless explicitly selected.
|
|
11
|
+
*
|
|
12
|
+
* Why this file exists alongside `packages/agoric-cli/src/anylogger-agoric.js`:
|
|
13
|
+
* - This adapter enforces production/runtime log policy.
|
|
14
|
+
* - The CLI adapter is tuned for terminal UX (e.g., colored prefixes) and does
|
|
15
|
+
* not apply cosmic-swingset suppression semantics.
|
|
16
|
+
*/
|
|
1
17
|
/* eslint-env node */
|
|
2
18
|
import {
|
|
3
19
|
getEnvironmentOptionsList,
|
|
4
20
|
getEnvironmentOption,
|
|
5
21
|
} from '@endo/env-options';
|
|
6
|
-
import anylogger from 'anylogger';
|
|
22
|
+
import anylogger from '@agoric/internal/vendor/anylogger.js';
|
|
7
23
|
import { defineName } from '@agoric/internal/src/js-utils.js';
|
|
8
24
|
|
|
9
|
-
/** @import {BaseLevels} from 'anylogger'; */
|
|
25
|
+
/** @import {BaseLevels} from '@agoric/internal/vendor/anylogger.js'; */
|
|
10
26
|
/** @typedef {keyof BaseLevels} LogLevel; */
|
|
11
27
|
|
|
12
28
|
const VAT_LOGGER_PREFIXES = Object.freeze([
|
|
@@ -42,14 +58,15 @@ const maxActiveLevelCode = /** @type {number} */ (
|
|
|
42
58
|
|
|
43
59
|
const oldExt = anylogger.ext;
|
|
44
60
|
anylogger.ext = logger => {
|
|
45
|
-
|
|
61
|
+
const extended = oldExt(logger);
|
|
46
62
|
|
|
47
63
|
/** @type {(level: LogLevel) => boolean} */
|
|
48
64
|
const enabledFor = level => anylogger.levels[level] <= maxActiveLevelCode;
|
|
49
|
-
|
|
65
|
+
extended.enabledFor = enabledFor;
|
|
50
66
|
|
|
51
|
-
const nameColon = `${
|
|
52
|
-
const label =
|
|
67
|
+
const nameColon = `${extended.name}:`;
|
|
68
|
+
const label = extended.name.replaceAll(':', ': ');
|
|
69
|
+
const fallbackSink = console.log.bind(console);
|
|
53
70
|
|
|
54
71
|
// Vat logs are suppressed unless matched by a prefix in DEBUG_LIST.
|
|
55
72
|
const suppressed =
|
|
@@ -58,9 +75,11 @@ anylogger.ext = logger => {
|
|
|
58
75
|
|
|
59
76
|
const levels = /** @type {LogLevel[]} */ (Object.keys(anylogger.levels));
|
|
60
77
|
for (const level of levels) {
|
|
61
|
-
const impl =
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
const impl =
|
|
79
|
+
(typeof console[level] === 'function' && console[level].bind(console)) ||
|
|
80
|
+
fallbackSink;
|
|
81
|
+
const disabled = suppressed || !enabledFor(level);
|
|
82
|
+
extended[level] = disabled
|
|
64
83
|
? defineName(`dummy ${level}`, () => {})
|
|
65
84
|
: defineName(level, (...args) => {
|
|
66
85
|
// Prepend a timestamp and label.
|
|
@@ -68,5 +87,5 @@ anylogger.ext = logger => {
|
|
|
68
87
|
impl(`${timestamp} ${label}:`, ...args);
|
|
69
88
|
});
|
|
70
89
|
}
|
|
71
|
-
return
|
|
90
|
+
return extended;
|
|
72
91
|
};
|
package/src/entrypoint.js
CHANGED
|
@@ -12,7 +12,7 @@ import path from 'path';
|
|
|
12
12
|
import process from 'process';
|
|
13
13
|
|
|
14
14
|
import './anylogger-agoric.js';
|
|
15
|
-
import anylogger from 'anylogger';
|
|
15
|
+
import anylogger from '@agoric/internal/vendor/anylogger.js';
|
|
16
16
|
import main from './chain-main.js';
|
|
17
17
|
|
|
18
18
|
const log = anylogger('ag-chain-cosmos');
|
package/src/launch-chain.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// so let the JS tooling know about it by importing it here.
|
|
5
5
|
import '@agoric/builders';
|
|
6
6
|
|
|
7
|
-
import anylogger from 'anylogger';
|
|
7
|
+
import anylogger from '@agoric/internal/vendor/anylogger.js';
|
|
8
8
|
|
|
9
9
|
import bundleSource from '@endo/bundle-source';
|
|
10
10
|
import { assert, Fail, makeError, X } from '@endo/errors';
|
package/src/sim-chain.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
exportMailbox,
|
|
8
8
|
} from '@agoric/swingset-vat/src/devices/mailbox/mailbox.js';
|
|
9
9
|
|
|
10
|
-
import anylogger from 'anylogger';
|
|
10
|
+
import anylogger from '@agoric/internal/vendor/anylogger.js';
|
|
11
11
|
|
|
12
12
|
import { getTelemetryProviders, makeSlogSender } from '@agoric/telemetry';
|
|
13
13
|
|