agoric 0.21.2-dev-fa6d3d3.0.fa6d3d3 → 0.21.2-dev-e3099cb.0.e3099cb

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agoric",
3
- "version": "0.21.2-dev-fa6d3d3.0.fa6d3d3",
3
+ "version": "0.21.2-dev-e3099cb.0.e3099cb",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -29,28 +29,28 @@
29
29
  "lint:eslint": "yarn run -T eslint ."
30
30
  },
31
31
  "devDependencies": {
32
- "@agoric/cosmic-swingset": "0.41.4-dev-fa6d3d3.0.fa6d3d3",
33
- "@agoric/deploy-script-support": "0.10.4-dev-fa6d3d3.0.fa6d3d3",
32
+ "@agoric/cosmic-swingset": "0.41.4-dev-e3099cb.0.e3099cb",
33
+ "@agoric/deploy-script-support": "0.10.4-dev-e3099cb.0.e3099cb",
34
34
  "ava": "^6.4.1",
35
35
  "c8": "^10.1.2"
36
36
  },
37
37
  "dependencies": {
38
- "@agoric/access-token": "0.4.22-dev-fa6d3d3.0.fa6d3d3",
39
- "@agoric/cache": "0.3.3-dev-fa6d3d3.0.fa6d3d3",
40
- "@agoric/casting": "0.4.3-dev-fa6d3d3.0.fa6d3d3",
41
- "@agoric/client-utils": "0.1.1-dev-fa6d3d3.0.fa6d3d3",
42
- "@agoric/cosmic-proto": "0.4.1-dev-fa6d3d3.0.fa6d3d3",
43
- "@agoric/ertp": "0.16.3-dev-fa6d3d3.0.fa6d3d3",
44
- "@agoric/governance": "0.10.4-dev-fa6d3d3.0.fa6d3d3",
45
- "@agoric/inter-protocol": "0.16.2-dev-fa6d3d3.0.fa6d3d3",
46
- "@agoric/internal": "0.3.3-dev-fa6d3d3.0.fa6d3d3",
47
- "@agoric/network": "0.1.1-dev-fa6d3d3.0.fa6d3d3",
48
- "@agoric/smart-wallet": "0.5.4-dev-fa6d3d3.0.fa6d3d3",
49
- "@agoric/store": "0.9.3-dev-fa6d3d3.0.fa6d3d3",
50
- "@agoric/swingset-vat": "0.32.3-dev-fa6d3d3.0.fa6d3d3",
51
- "@agoric/vats": "0.15.2-dev-fa6d3d3.0.fa6d3d3",
52
- "@agoric/zoe": "0.26.3-dev-fa6d3d3.0.fa6d3d3",
53
- "@agoric/zone": "0.2.3-dev-fa6d3d3.0.fa6d3d3",
38
+ "@agoric/access-token": "0.4.22-dev-e3099cb.0.e3099cb",
39
+ "@agoric/cache": "0.3.3-dev-e3099cb.0.e3099cb",
40
+ "@agoric/casting": "0.4.3-dev-e3099cb.0.e3099cb",
41
+ "@agoric/client-utils": "0.1.1-dev-e3099cb.0.e3099cb",
42
+ "@agoric/cosmic-proto": "0.4.1-dev-e3099cb.0.e3099cb",
43
+ "@agoric/ertp": "0.16.3-dev-e3099cb.0.e3099cb",
44
+ "@agoric/governance": "0.10.4-dev-e3099cb.0.e3099cb",
45
+ "@agoric/inter-protocol": "0.16.2-dev-e3099cb.0.e3099cb",
46
+ "@agoric/internal": "0.3.3-dev-e3099cb.0.e3099cb",
47
+ "@agoric/network": "0.1.1-dev-e3099cb.0.e3099cb",
48
+ "@agoric/smart-wallet": "0.5.4-dev-e3099cb.0.e3099cb",
49
+ "@agoric/store": "0.9.3-dev-e3099cb.0.e3099cb",
50
+ "@agoric/swingset-vat": "0.32.3-dev-e3099cb.0.e3099cb",
51
+ "@agoric/vats": "0.15.2-dev-e3099cb.0.e3099cb",
52
+ "@agoric/zoe": "0.26.3-dev-e3099cb.0.e3099cb",
53
+ "@agoric/zone": "0.2.3-dev-e3099cb.0.e3099cb",
54
54
  "@cosmjs/crypto": "^0.36.0",
55
55
  "@cosmjs/encoding": "^0.36.0",
56
56
  "@cosmjs/math": "^0.36.0",
@@ -70,7 +70,6 @@
70
70
  "@endo/promise-kit": "^1.1.13",
71
71
  "@endo/zip": "^1.0.11",
72
72
  "@iarna/toml": "^2.2.3",
73
- "anylogger": "^0.21.0",
74
73
  "chalk": "^5.2.0",
75
74
  "commander": "^12.1.0",
76
75
  "deterministic-json": "^1.0.5",
@@ -102,5 +101,5 @@
102
101
  "engines": {
103
102
  "node": "^20.9 || ^22.11"
104
103
  },
105
- "gitHead": "fa6d3d3633f3a11ab3946e0d02901883b71847a9"
104
+ "gitHead": "e3099cb9b5af514813cf606753b3743fd361bcf8"
106
105
  }
@@ -1,9 +1,27 @@
1
+ /**
2
+ * @file agoric-cli anylogger adapter.
3
+ *
4
+ * Use this module as a side-effect import from CLI entrypoints when you want
5
+ * Agoric-prefixed loggers to respect `DEBUG` and emit styled output.
6
+ *
7
+ * How it works:
8
+ * - Reads `DEBUG` values like `agoric` or `agoric:<level>`.
9
+ * - Overrides `anylogger.ext` to enable/disable levels consistently.
10
+ * - Wraps enabled log methods with an `agoric`-style prefix.
11
+ *
12
+ * Why this file exists alongside `packages/cosmic-swingset/src/anylogger-agoric.js`:
13
+ * - This CLI adapter is optimized for interactive terminal UX (colored labels).
14
+ * - Cosmic-swingset logging targets chain/runtime service logs (timestamps,
15
+ * vat-prefix suppression, and `agoric:none` semantics).
16
+ * - Keeping separate adapters avoids coupling CLI output behavior to
17
+ * cosmic-swingset operational logging requirements.
18
+ */
1
19
  /* eslint-env node */
2
20
  import {
3
21
  getEnvironmentOption,
4
22
  getEnvironmentOptionsList,
5
23
  } from '@endo/env-options';
6
- import anylogger from 'anylogger';
24
+ import anylogger from '@agoric/internal/vendor/anylogger.js';
7
25
  import chalk from 'chalk';
8
26
 
9
27
  const DEBUG_LIST = getEnvironmentOptionsList('DEBUG');
@@ -30,19 +48,25 @@ const globalCode = selectedCode === undefined ? -Infinity : selectedCode;
30
48
  const oldExt = anylogger.ext;
31
49
  /** @type {typeof anylogger.ext} */
32
50
  anylogger.ext = (l, ...rest) => {
33
- l = oldExt(l, ...rest);
34
- l.enabledFor = lvl => globalCode >= anylogger.levels[lvl];
51
+ const logger = oldExt(l, ...rest);
52
+ logger.enabledFor = lvl =>
53
+ lvl !== undefined && globalCode >= anylogger.levels[lvl];
35
54
 
36
- const prefix = l.name.replace(/:/g, ': ');
55
+ const prefix = logger.name.replace(/:/g, ': ');
56
+ const fallbackSink = console.log.bind(console);
37
57
  for (const [level, code] of Object.entries(anylogger.levels)) {
38
58
  if (globalCode >= code) {
39
59
  // Enable the printing with a prefix.
40
- const doLog = l[level] || (() => {});
41
- l[level] = (...args) => doLog(chalk.bold.blue(`${prefix}:`), ...args);
60
+ const doLog =
61
+ (typeof console[level] === 'function' &&
62
+ console[level].bind(console)) ||
63
+ fallbackSink;
64
+ logger[level] = (...args) =>
65
+ doLog(chalk.bold.blue(`${prefix}:`), ...args);
42
66
  } else {
43
67
  // Disable printing.
44
- l[level] = () => {};
68
+ logger[level] = () => {};
45
69
  }
46
70
  }
47
- return l;
71
+ return logger;
48
72
  };
package/src/bin-agops.js CHANGED
@@ -10,7 +10,7 @@ import { E } from '@endo/far';
10
10
  import { execFileSync } from 'child_process';
11
11
  import path from 'path';
12
12
  import process from 'process';
13
- import anylogger from 'anylogger';
13
+ import anylogger from '@agoric/internal/vendor/anylogger.js';
14
14
  import { Command, CommanderError, createCommand } from 'commander';
15
15
  import { makeOracleCommand } from './commands/oracle.js';
16
16
  import { makeGovCommand } from './commands/gov.js';
@@ -22,7 +22,7 @@ import {
22
22
  * @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js';
23
23
  * @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js';
24
24
  * @import {VstorageKit} from '@agoric/client-utils';
25
- * @import {Logger} from 'anylogger';
25
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
26
26
  * @import {Writable} from 'stream';
27
27
  */
28
28
 
@@ -28,7 +28,7 @@ import {
28
28
  * @import {createCommand} from 'commander';
29
29
  * @import {execFileSync} from 'child_process';
30
30
  * @import {Writable} from 'stream';
31
- * @import {Logger} from 'anylogger';
31
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
32
32
  * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
33
33
  * @import {TimestampRecord} from '@agoric/time';
34
34
  */
@@ -20,7 +20,7 @@ import {
20
20
  } from '../lib/chain.js';
21
21
 
22
22
  /**
23
- * @import {Logger} from 'anylogger';
23
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
24
24
  */
25
25
 
26
26
  // tight for perf testing but less than this tends to hang.
@@ -13,7 +13,7 @@ import { asPercent } from '../lib/format.js';
13
13
  import { outputExecuteOfferAction } from '../lib/wallet.js';
14
14
 
15
15
  /**
16
- * @import {Logger} from 'anylogger';
16
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
17
17
  * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
18
18
  */
19
19
 
@@ -11,7 +11,7 @@ import { Command } from 'commander';
11
11
  import { outputActionAndHint } from '../lib/wallet.js';
12
12
 
13
13
  /**
14
- * @import {Logger} from 'anylogger';
14
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
15
15
  * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
16
16
  */
17
17
 
@@ -15,7 +15,7 @@ import { normalizeAddressWithOptions } from '../lib/chain.js';
15
15
  import { getCurrent, outputExecuteOfferAction } from '../lib/wallet.js';
16
16
 
17
17
  /**
18
- * @import {Logger} from 'anylogger';
18
+ * @import {Logger} from '@agoric/internal/vendor/anylogger.js';
19
19
  */
20
20
 
21
21
  const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
package/src/entrypoint.js CHANGED
@@ -12,7 +12,7 @@ import os from 'os';
12
12
 
13
13
  // Configure logs.
14
14
  import './anylogger-agoric.js';
15
- import anylogger from 'anylogger';
15
+ import anylogger from '@agoric/internal/vendor/anylogger.js';
16
16
 
17
17
  import main from './main.js';
18
18