1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-29 06:37:39 +00:00

Syncer: allow logging to be disabled

We don't want the syncer used by the savetrail plugin to be logging
This commit is contained in:
Jermolene
2017-09-26 17:10:57 +01:00
parent 1dcc8c99e5
commit 05a3d9a302
2 changed files with 45 additions and 38 deletions

View File

@@ -42,8 +42,12 @@ function Syncer(options) {
this.throttleInterval = options.throttleInterval || this.throttleInterval;
this.fallbackInterval = options.fallbackInterval || this.fallbackInterval;
this.pollTimerInterval = options.pollTimerInterval || this.pollTimerInterval;
this.logging = "logging" in options ? options.logging : true;
// Make a logger
this.logger = new $tw.utils.Logger("syncer" + ($tw.browser ? "-browser" : "") + ($tw.node ? "-server" : "") + (this.syncadaptor.name ? ("-" + this.syncadaptor.name) : ""),{colour: "cyan"});
this.logger = new $tw.utils.Logger("syncer" + ($tw.browser ? "-browser" : "") + ($tw.node ? "-server" : "") + (this.syncadaptor.name ? ("-" + this.syncadaptor.name) : ""),{
colour: "cyan",
enable: this.logging
});
// Compile the dirty tiddler filter
this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));
// Record information for known tiddlers