Skip to content

Commit

Permalink
add log.error
Browse files Browse the repository at this point in the history
  • Loading branch information
rpdg committed Aug 27, 2020
1 parent 12b3fdc commit 165f9f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rpdg/epg-panel",
"version": "2.0.3",
"version": "2.0.4",
"description": "A javascript library for epg on STB (smart TV box)",
"bugs": "https://github.com/rpdg/jPanel/issues",
"homepage": "https://github.com/rpdg/jPanel",
Expand Down
11 changes: 11 additions & 0 deletions src/utils/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
}
};

window.console.error = function (...data: any[]) {
if (elChild.scrollHeight > 600) {
elChild.innerHTML = '';
} else {
elChild.innerHTML += '<hr>';
}
for (var i = 0, len = data.length; i < len; i++) {
elChild.innerHTML += `<span style="color:red;font-size: 16px;">${data[i]}</span><hr>`;
}
};

window.console.clear = function () {
elChild.innerHTML = '';
};
Expand Down

0 comments on commit 165f9f7

Please sign in to comment.