mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-25 00:11:36 +01:00
Changed levels of WS logs
This commit is contained in:
parent
3f87e9e4b4
commit
3d290114fa
|
@ -25,18 +25,18 @@ export class WebSockets {
|
||||||
console.error("WS: Error observed, you aren't logged probably.");
|
console.error("WS: Error observed, you aren't logged probably.");
|
||||||
window.location.replace(ForisURLs.login);
|
window.location.replace(ForisURLs.login);
|
||||||
}
|
}
|
||||||
console.log(`WS: Error: ${e}`);
|
console.error(`WS: Error: ${e}`);
|
||||||
};
|
};
|
||||||
this.ws.onmessage = (e) => {
|
this.ws.onmessage = (e) => {
|
||||||
console.log(`WS: Received Message: ${e.data}`);
|
console.debug(`WS: Received Message: ${e.data}`);
|
||||||
const data = JSON.parse(e.data);
|
const data = JSON.parse(e.data);
|
||||||
this.dispatch(data);
|
this.dispatch(data);
|
||||||
};
|
};
|
||||||
this.ws.onopen = () => {
|
this.ws.onopen = () => {
|
||||||
console.log("WS: Connection open.");
|
console.debug("WS: Connection open.");
|
||||||
};
|
};
|
||||||
this.ws.onclose = () => {
|
this.ws.onclose = () => {
|
||||||
console.log("WS: Connection closed.");
|
console.debug("WS: Connection closed.");
|
||||||
};
|
};
|
||||||
|
|
||||||
// callbacks[module][action]
|
// callbacks[module][action]
|
||||||
|
@ -111,7 +111,7 @@ export class WebSockets {
|
||||||
chain = this.callbacks[json.module][json.action];
|
chain = this.callbacks[json.module][json.action];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof TypeError) {
|
if (error instanceof TypeError) {
|
||||||
console.log(`Callback for this message wasn't found:${error.data}`);
|
console.warn(`Callback for this message wasn't found:${error.data}`);
|
||||||
} else throw error;
|
} else throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user