diff light9/web/SyncedGraph.ts @ 2277:f61531e21a77

logging
author drewp@bigasterisk.com
date Mon, 29 May 2023 15:18:04 -0700
parents 1b7cde922c3d
children 702c1fd95dfd
line wrap: on
line diff
--- a/light9/web/SyncedGraph.ts	Mon May 29 15:17:28 2023 -0700
+++ b/light9/web/SyncedGraph.ts	Mon May 29 15:18:04 2023 -0700
@@ -156,11 +156,11 @@
       log("not connected-- dropping patch");
       return;
     }
-    if (patch.isEmpty()) throw 'should not get to this point with empty patch'
+    if (patch.isEmpty()) throw "should not get to this point with empty patch";
 
     this._applyPatch(patch);
     if (this.client) {
-      log("sending patch:\n", patch.dump())
+      log("sending patch:\n", patch.dump());
       this.client.sendPatch(patch);
     }
     console.timeEnd("applyAndSendPatch");
@@ -170,12 +170,15 @@
     // In most cases you want applyAndSendPatch.
     //
     // This is the only method that writes to this.graph!
-    log("_applyPatch [1]\n", patch.dump());
+    log("_applyPatch [1] \n", patch.dump());
     this.cachedFloatValues.clear();
     this.cachedUriValues.clear();
     patch.applyToGraph(this.graph);
-    log("applied patch locally", patch.summary());
-    log('dump:\n'+patch.dump());
+    if (false) {
+      log("applied patch locally", patch.summary());
+    } else {
+      log("applied patch locally:\n" + patch.dump());
+    }
     this.autoDeps.graphChanged(patch);
   }