Skip to content

Commit

Permalink
fix logging from previous
Browse files Browse the repository at this point in the history
  • Loading branch information
sandervonk committed Jul 4, 2024
1 parent be04bbd commit 0197695
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 5 additions & 2 deletions public/docs/common_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @file common/index.ts
* @namespace common
*/
var _a;
var LogTone;
(function (LogTone) {
LogTone["Log"] = "log";
Expand Down Expand Up @@ -47,7 +48,7 @@
* @example _log("Hello world!");
* */
function _log(...args) {
log.push({ time: Date.now(), message: arguments[0], type: tone || LogTone.Log });
log.push({ time: Date.now(), message: arguments[0], type: this || LogTone.Log });
if (arguments.length == 0)
return;
// check for very large messages and warn them in the console with the first 100 characters (make sure this catches the message, even if it's not the first argument, or in a object format)
Expand Down Expand Up @@ -140,8 +141,10 @@
* */
const _statuslog = _log.bind(LogTone.Info);
try {
window._status = _status;
const version = ((_a = document.getElementById("version")) === null || _a === void 0 ? void 0 : _a.textContent) || "< not found >";
_status.debug(`🚀 Loaded into ${process.env.NODE_ENV} build @ version [${version}]`);
_status.log("📜 Initialized logger");
window._status = _status;
}
catch (err) {
_status.log("⚠ Couldn't set window._status", err);
Expand Down
Loading

0 comments on commit 0197695

Please sign in to comment.