Skip to content

Commit 7ac6ec6

Browse files
committed
Revert "Add configurable logging"
This reverts commit b3f55f2.
1 parent b3f55f2 commit 7ac6ec6

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

obj.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@
1616
// Store state in a global `obs` object for reuse later in your application.
1717
window.obs = window.obs || {};
1818

19-
// Optional logging driven by configuration.
20-
// Set before loading obj.js, e.g.:
21-
// window.obs = { config: { log: true } }
22-
const obsConfig = (window.obs && window.obs.config) || {};
23-
const shouldLog = !!obsConfig.log;
24-
25-
// Simple logger: prints current values on `window.obs` (except `config`).
26-
const logObs = () => {
27-
if (!shouldLog) return;
28-
try {
29-
for (const [key, value] of Object.entries(window.obs)) {
30-
if (key === 'config') continue;
31-
console.log('[obs]', key, value);
32-
}
33-
} catch (e) {
34-
for (const key in window.obs) {
35-
if (Object.prototype.hasOwnProperty.call(window.obs, key) && key !== 'config') {
36-
console.log('[obs]', key, window.obs[key]);
37-
}
38-
}
39-
}
40-
};
41-
4219
// Helper function:
4320
// Bucket RTT into the nearest upper 25ms. E.g. an RTT of 108ms would be put
4421
// into the 125ms bucket. Think of 125ms as being 100–125ms.
@@ -116,7 +93,6 @@
11693
if ('downlinkMax' in connection) {
11794
window.obs.downlinkMax = connection.downlinkMax;
11895
}
119-
12096
};
12197

12298
// Run the connection function immediately.
@@ -153,10 +129,6 @@
153129
const isCharging = !!charging;
154130
window.obs.batteryCharging = isCharging;
155131
html.classList.toggle('has-battery-charging', isCharging);
156-
157-
// Once Battery has returned, log everything we have.
158-
logObs();
159-
160132
};
161133

162134
// Battery metrics (best‑effort and privacy‑respecting).
@@ -180,5 +152,4 @@
180152
// Fail silently.
181153
.catch(() => { /* no‑op */ });
182154
}
183-
184155
})();

0 commit comments

Comments
 (0)