[js] have shm_log specifically use a section, like the server-side functions
This commit is contained in:
parent
9e64ffeb66
commit
11a0ba27e9
1 changed files with 3 additions and 3 deletions
|
@ -5,11 +5,11 @@ function shm_cookie_get(name) {
|
|||
return Cookies.get(name);
|
||||
}
|
||||
|
||||
function shm_log(...message) {
|
||||
window.dispatchEvent(new CustomEvent("shm_log", {detail: {message: message}}));
|
||||
function shm_log(section, ...message) {
|
||||
window.dispatchEvent(new CustomEvent("shm_log", {detail: {section, message}}));
|
||||
}
|
||||
window.addEventListener("shm_log", function (e) {
|
||||
console.log(...e.detail.message);
|
||||
console.log(e.detail.section, ...e.detail.message);
|
||||
});
|
||||
window.addEventListener("error", function (e) {
|
||||
shm_log("Window error:", e.error);
|
||||
|
|
Reference in a new issue