From fea3ba0c7d35537ce0b0604958485c31dcef9ab5 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Sun, 31 Dec 2023 16:35:57 -0800 Subject: [PATCH] fix(eventual-send): switch DEBUG option to be comma separated --- packages/eventual-send/src/track-turns.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/eventual-send/src/track-turns.js b/packages/eventual-send/src/track-turns.js index 0ecd029409..06b3d324e6 100644 --- a/packages/eventual-send/src/track-turns.js +++ b/packages/eventual-send/src/track-turns.js @@ -1,5 +1,8 @@ /* global globalThis */ -import { getEnvironmentOption } from '@endo/env-options'; +import { + getEnvironmentOption, + environmentOptionsListHas, +} from '@endo/env-options'; // NOTE: We can't import these because they're not in scope before lockdown. // import { assert, details as X, Fail } from '@agoric/assert'; @@ -15,16 +18,8 @@ let hiddenPriorError; let hiddenCurrentTurn = 0; let hiddenCurrentEvent = 0; -const DEBUG = getEnvironmentOption('DEBUG', ''); - // Turn on if you seem to be losing error logging at the top of the event loop -// -// TODO This use of colon (`':'`) as a separator is a bad legacy convention. -// It should be comma (`','`). Once we can switch it to comma, then use the -// following commented out definition of `VERBOSE` instead. -// const VERBOSE = environmentOptionsListHas('DEBUG', 'track-turns'); -// See /~https://github.com/Agoric/agoric-sdk/issues/8096 -const VERBOSE = DEBUG.split(':').includes('track-turns'); +const VERBOSE = environmentOptionsListHas('DEBUG', 'track-turns'); // Track-turns is disabled by default and can be enabled by an environment // option.