@bian-womp/spark-graph 0.3.47 → 0.3.48

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/lib/cjs/index.cjs CHANGED
@@ -1104,10 +1104,13 @@ class LevelLogger {
1104
1104
  const effectiveValue = LevelLogger.levelValues[effectiveLevel] ?? 1;
1105
1105
  // Only log if the requested level is >= effective level
1106
1106
  if (requestedValue >= effectiveValue) {
1107
- const contextStr = context
1108
- ? ` ${Object.entries(context)
1109
- .map(([k, v]) => `${k}=${JSON.stringify(v)}`)
1110
- .join(" ")}`
1107
+ const { formatJson, ...rest } = context ?? {};
1108
+ const contextStr = rest && Object.keys(rest).length > 0
1109
+ ? `${formatJson ? "\n" : " "}${Object.entries(rest)
1110
+ .map(([k, v]) => formatJson
1111
+ ? `\n${k}=${JSON.stringify(v, undefined, 2)}`
1112
+ : `${k}=${JSON.stringify(v)}`)
1113
+ .join(formatJson ? "\n" : " ")}`
1111
1114
  : "";
1112
1115
  const prefixedMessage = this.prefix
1113
1116
  ? `${this.prefix} ${message}${contextStr}`
@@ -2856,6 +2859,7 @@ class NodeExecutor {
2856
2859
  }
2857
2860
  if (currentNode) {
2858
2861
  ctx.log("debug", "node-done", {
2862
+ formatJson: true,
2859
2863
  durationMs: currentNode.stats.lastDurationMs,
2860
2864
  hadError,
2861
2865
  inputs: currentNode.inputs
@@ -3021,7 +3025,7 @@ class GraphRuntime {
3021
3025
  // Initialize components
3022
3026
  this.eventEmitter = new EventEmitter();
3023
3027
  this.graph = new Graph(this.eventEmitter);
3024
- this.runContextManager = new RunContextManager(this.graph, "info");
3028
+ this.runContextManager = new RunContextManager(this.graph, "warn");
3025
3029
  this.handleResolver = new HandleResolver(this.graph, this.eventEmitter, this.runContextManager, this);
3026
3030
  this.edgePropagator = new EdgePropagator(this.graph, this.eventEmitter, this.runContextManager, this.handleResolver, this);
3027
3031
  // Create NodeExecutor with EdgePropagator and HandleResolver