@cadenza.io/core 1.11.7 → 1.11.8

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/index.mjs CHANGED
@@ -38,6 +38,7 @@ var SignalBroker = class _SignalBroker {
38
38
  // execId -> emitted signals
39
39
  constructor() {
40
40
  this.debug = false;
41
+ this.verbose = false;
41
42
  this.signalObservers = /* @__PURE__ */ new Map();
42
43
  this.emitStacks = /* @__PURE__ */ new Map();
43
44
  this.addSignal("meta.signal_broker.added");
@@ -55,6 +56,9 @@ var SignalBroker = class _SignalBroker {
55
56
  setDebug(value) {
56
57
  this.debug = value;
57
58
  }
59
+ setVerbose(value) {
60
+ this.verbose = value;
61
+ }
58
62
  validateSignalName(signalName) {
59
63
  if (signalName.length > 100) {
60
64
  throw new Error(
@@ -158,8 +162,10 @@ var SignalBroker = class _SignalBroker {
158
162
  }
159
163
  }
160
164
  execute(signal, context) {
165
+ var _a;
161
166
  const isMeta = signal.startsWith("meta.");
162
167
  const isSubMeta = signal.startsWith("sub_meta.");
168
+ const isMetric = (_a = context.__signalEmission) == null ? void 0 : _a.isMetric;
163
169
  if (!isSubMeta && (!isMeta || this.debug)) {
164
170
  const emittedAt = Date.now();
165
171
  context.__signalEmission = {
@@ -176,7 +182,7 @@ var SignalBroker = class _SignalBroker {
176
182
  } else {
177
183
  delete context.__signalEmission;
178
184
  }
179
- if (this.debug) {
185
+ if (this.debug && (!isMetric || this.verbose)) {
180
186
  console.log(
181
187
  `Emitting signal ${signal} with context ${JSON.stringify(context)}`
182
188
  );
@@ -946,7 +952,8 @@ var GraphNode = class _GraphNode extends SignalEmitter {
946
952
  if (!this.task.isHidden) {
947
953
  data.__signalEmission = {
948
954
  taskId: this.task.id,
949
- taskExecutionId: this.id
955
+ taskExecutionId: this.id,
956
+ isMetric: true
950
957
  };
951
958
  data.__metadata = {
952
959
  __routineExecId: this.routineExecId
@@ -3018,6 +3025,11 @@ var Cadenza = class {
3018
3025
  this.broker.setDebug(true);
3019
3026
  this.runner.setDebug(true);
3020
3027
  }
3028
+ if (mode === "verbose") {
3029
+ this.broker.setDebug(true);
3030
+ this.broker.setVerbose(true);
3031
+ this.runner.setDebug(true);
3032
+ }
3021
3033
  }
3022
3034
  /**
3023
3035
  * Validates a name for uniqueness and non-emptiness.