Changeset - f61531e21a77
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 months ago 2023-05-29 22:18:04
drewp@bigasterisk.com
logging
2 files changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/web/SyncedGraph.ts
Show inline comments
 
@@ -156,11 +156,11 @@ export class SyncedGraph {
 
      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");
 
@@ -174,8 +174,11 @@ export class SyncedGraph {
 
    this.cachedFloatValues.clear();
 
    this.cachedUriValues.clear();
 
    patch.applyToGraph(this.graph);
 
    if (false) {
 
    log("applied patch locally", patch.summary());
 
    log('dump:\n'+patch.dump());
 
    } else {
 
      log("applied patch locally:\n" + patch.dump());
 
    }
 
    this.autoDeps.graphChanged(patch);
 
  }
 

	
light9/web/patch.ts
Show inline comments
 
@@ -94,7 +94,7 @@ export class Patch {
 
    this.dels.forEach((d) => lines.push(delPrefix + s(d.subject) + " " + s(d.predicate) + " " + s(d.object)));
 
    this.adds.forEach((d) => lines.push(addPrefix + s(d.subject) + " " + s(d.predicate) + " " + s(d.object)));
 
    lines.sort();
 
    return lines.join("\n");
 
    return lines.join("\n") + "\n" + (this.isEmpty() ? "(empty)" : "(nonempty)");
 
  }
 

	
 
  async toJsonPatch(): Promise<string> {
0 comments (0 inline, 0 general)