Use pluggable logger rather the puts
This commit is contained in:
@@ -99,6 +99,15 @@ Handlebars.registerHelper('if', function(context, fn, inverse) {
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.logger = {
|
||||
DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
|
||||
|
||||
// override in the host environment
|
||||
log: function(level, str) {},
|
||||
}
|
||||
|
||||
Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
|
||||
|
||||
// END(BROWSER)
|
||||
|
||||
exports.Handlebars = Handlebars;
|
||||
|
||||
@@ -250,8 +250,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
|
||||
this.compileChildren(environment);
|
||||
|
||||
//puts(environment.disassemble());
|
||||
//puts("")
|
||||
Handlebars.log(Handlebars.logger.DEBUG, environment.disassemble() + "\n\n");
|
||||
|
||||
var opcodes = environment.opcodes;
|
||||
var opcode, name;
|
||||
@@ -315,8 +314,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
var fn = Function.apply(this, params);
|
||||
fn.displayName = "Handlebars.js"
|
||||
|
||||
//puts(fn.toString())
|
||||
//puts("")
|
||||
Handlebars.log(Handlebars.logger.DEBUG, fn.toString() + "\n\n");
|
||||
|
||||
container.render = fn;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user