mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-10 05:52:50 +00:00
Clearer logging preparatory to implementing file synchronisation
This commit is contained in:
parent
7df3d48451
commit
70def07d63
@ -124,9 +124,7 @@ var Command = function(params,commander,callback) {
|
|||||||
if(fields["revision"]) {
|
if(fields["revision"]) {
|
||||||
delete fields["revision"];
|
delete fields["revision"];
|
||||||
}
|
}
|
||||||
var fileInfo = $tw.boot.files[title],
|
console.log("PUT tiddler",title)
|
||||||
filepath = fileInfo ? fileInfo.filepath : null;
|
|
||||||
console.log("PUT tiddler",title,filepath,fields)
|
|
||||||
state.wiki.addTiddler(new $tw.Tiddler(fields,{title: title}));
|
state.wiki.addTiddler(new $tw.Tiddler(fields,{title: title}));
|
||||||
var changeCount = state.wiki.getChangeCount(title).toString();
|
var changeCount = state.wiki.getChangeCount(title).toString();
|
||||||
response.writeHead(204, "OK",{
|
response.writeHead(204, "OK",{
|
||||||
@ -140,9 +138,7 @@ console.log("PUT tiddler",title,filepath,fields)
|
|||||||
path: /^\/bags\/default\/tiddlers\/(.+)$/,
|
path: /^\/bags\/default\/tiddlers\/(.+)$/,
|
||||||
handler: function(request,response,state) {
|
handler: function(request,response,state) {
|
||||||
var title = decodeURIComponent(state.params[0]);
|
var title = decodeURIComponent(state.params[0]);
|
||||||
var fileInfo = $tw.boot.files[title],
|
console.log("DELETE tiddler",title)
|
||||||
filepath = fileInfo ? fileInfo.filepath : null;
|
|
||||||
console.log("DELETE tiddler",title,filepath)
|
|
||||||
state.wiki.deleteTiddler(title);
|
state.wiki.deleteTiddler(title);
|
||||||
response.writeHead(204, "OK");
|
response.writeHead(204, "OK");
|
||||||
response.end();
|
response.end();
|
||||||
|
@ -46,7 +46,8 @@ Message logging
|
|||||||
Syncer.prototype.log = function(/* arguments */) {
|
Syncer.prototype.log = function(/* arguments */) {
|
||||||
var args = Array.prototype.slice.call(arguments,0);
|
var args = Array.prototype.slice.call(arguments,0);
|
||||||
args[0] = "Syncer: " + args[0];
|
args[0] = "Syncer: " + args[0];
|
||||||
$tw.utils.log.apply(null,args);
|
// Temporarily disable logging to help the wood vs. trees situation; we need better filtering of log messages
|
||||||
|
//$tw.utils.log.apply(null,args);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,9 @@ FileSystemAdaptor.prototype.getTiddlerInfo = function(tiddler) {
|
|||||||
Save a tiddler and invoke the callback with (err,adaptorInfo,revision)
|
Save a tiddler and invoke the callback with (err,adaptorInfo,revision)
|
||||||
*/
|
*/
|
||||||
FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) {
|
FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) {
|
||||||
console.log("FileSystem: Saving",tiddler.fields);
|
var filepathInfo = $tw.boot.files[tiddler.fields.title],
|
||||||
|
filepath = filepathInfo ? $tw.boot.files[tiddler.fields.title].filepath : undefined;
|
||||||
|
console.log("FileSystem: Saving",filepath,tiddler.fields);
|
||||||
callback(null,{},0);
|
callback(null,{},0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user