Files
Superalgos/WebDebugLog.js
T
2019-05-27 21:10:46 -03:00

18 lines
353 B
JavaScript

function newWebDebugLog () {
let thisObject = {
write: write,
fileName: 'undefined'
}
return thisObject
function write (pText) {
console.log(spacePad(thisObject.fileName, 50) + ' : ' + pText)
function spacePad (str, max) {
str = str.toString()
return str.length < max ? spacePad(' ' + str, max) : str
}
}
}