Better Logging
This commit is contained in:
1 parent
57f6fef84f
commit
2020087080
1 file changed
+17
-13
+17
-13
@@ -1,17 +1,21 @@
|
||||
function newWebDebugLog () {
|
||||
let thisObject = {
|
||||
write: write,
|
||||
fileName: 'undefined'
|
||||
}
|
||||
try {
|
||||
let thisObject = {
|
||||
write: write,
|
||||
fileName: 'undefined'
|
||||
}
|
||||
|
||||
return thisObject
|
||||
return thisObject
|
||||
|
||||
function write (pText) {
|
||||
console.log(spacePad(thisObject.fileName, 50) + ' : ' + pText)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
function spacePad (str, max) {
|
||||
str = str.toString()
|
||||
return str.length < max ? spacePad(' ' + str, max) : str
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(spacePad(MODULE_NAME, 50) + ' : ' + '[ERROR] WebDebugLog --> err = ' + err.stack)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user