Introduce <$action-log> widget to help debugging action strings

This commit is contained in:
jeremy@jermolene.com 2020-11-14 13:00:00 +00:00
parent 02a956b1bb
commit 1b31c25ea7
3 changed files with 93 additions and 0 deletions

View file

@ -53,6 +53,19 @@ exports.warning = function(text) {
exports.log(text,"brown/orange");
};
/*
Log a table of name: value pairs
*/
exports.logTable = function(data,columnNames) {
if(console.table) {
console.table(data,columnNames);
} else {
$tw.utils.each(data,function(value,name) {
console.log(name + ": " + value);
});
}
}
/*
Return the integer represented by the str (string).
Return the dflt (default) parameter if str is not a base-10 number.