1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Add logging functions to commander

This commit is contained in:
Jermolene 2017-02-18 13:30:04 +00:00
parent 6f93ce6ea7
commit 74b0da065e

View File

@ -29,6 +29,24 @@ var Commander = function(commandTokens,callback,wiki,streams) {
this.outputPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiOutputSubDir);
};
/*
Log a string if verbose flag is set
*/
Commander.prototype.log = function(str) {
if(this.verbose) {
this.streams.output.write(str + "\n");
}
};
/*
Write a string if verbose flag is set
*/
Commander.prototype.write = function(str) {
if(this.verbose) {
this.streams.output.write(str);
}
};
/*
Add a string of tokens to the command queue
*/