Modify logging routines

This commit is contained in:
Christoph Diehl 2017-06-27 17:16:34 -07:00
parent 83ade20f6a
commit f8c61ab67a
2 changed files with 10 additions and 8 deletions

View File

@ -36,14 +36,18 @@ var logger = (function () { // eslint-disable-line no-unused-vars
console(msg)
}
function log (msg) {
dump('/*L*/ ' + utils.script.safely(msg) + '\n')
}
function dumpln (msg) {
dump(msg + '\n')
}
function log (msg) {
dumpln('/*L*/ ' + utils.script.safely(msg))
}
function info (msg) {
dumpln('/*L*/ /* ' + msg + ' */')
}
function error (msg) {
dumpln(color.red + msg + color.clear)
}
@ -57,7 +61,7 @@ var logger = (function () { // eslint-disable-line no-unused-vars
}
function comment (msg) {
dump('/* ' + msg + ' */')
dumpln('/* ' + msg + ' */')
}
function separator () {
@ -78,6 +82,7 @@ var logger = (function () { // eslint-disable-line no-unused-vars
console: console,
dump: dump,
log: log,
info: info,
error: error,
JSError: JSError,
dumpln: dumpln,

View File

@ -59,9 +59,6 @@ utils.script = {
return JSON.stringify(o)
},
safely: function (s) {
if (window.debug) {
return 'try { ' + s + ' } catch(e) { logger.JSError(e); }'
}
return 'try { ' + s + ' } catch(e) { }'
},
makeLoop: function (s, max) {