Change default log level to info

Eventually we want to fix this API so that you can provide per-instance levels, etc but for now this is a quick fix.

Fixes wycats/handlebars-site#91
This commit is contained in:
kpdecker
2015-02-07 12:27:02 -06:00
parent 752a28f24c
commit 95421271e3
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ export var logger = {
INFO: 1,
WARN: 2,
ERROR: 3,
level: 3,
level: 1,
// Can be overridden in the host environment
log: function(level, message) {
+6 -4
View File
@@ -276,15 +276,17 @@ describe('builtin helpers', function() {
equals(3, levelArg);
equals("whee", logArg);
});
it('should not output to console', function() {
it('should not output to info', function() {
var string = "{{log blah}}";
var hash = { blah: "whee" };
console.info = function() {
throw new Error();
console.info = function(log) {
equals("whee", log);
called = true;
};
shouldCompileTo(string, hash, "", "log should not display");
shouldCompileTo(string, hash, "");
equals(true, called);
});
it('should log at data level', function() {
var string = "{{log blah}}";