included more features
This commit is contained in:
parent
4eb4a6b8db
commit
7bf1c559d6
|
|
@ -229,7 +229,11 @@
|
||||||
this._wireControls();
|
this._wireControls();
|
||||||
this._startLogRefresh();
|
this._startLogRefresh();
|
||||||
|
|
||||||
log().info('Debug panel mounted');
|
// Force an initial log to verify logging works
|
||||||
|
setTimeout(() => {
|
||||||
|
log().info('Debug panel mounted and logging active');
|
||||||
|
log().info(`Panel visible at: ${this.panelState.left !== undefined ? `(${this.panelState.left}, ${this.panelState.top})` : '(bottom-right)'}`);
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
_wireControls() {
|
_wireControls() {
|
||||||
|
|
@ -473,7 +477,16 @@
|
||||||
_startLogRefresh() {
|
_startLogRefresh() {
|
||||||
const renderLogs = () => {
|
const renderLogs = () => {
|
||||||
if (!this.bodyLogs || this.collapsed) return;
|
if (!this.bodyLogs || this.collapsed) return;
|
||||||
const rows = log().buffer.slice(-80);
|
const logger = log();
|
||||||
|
if (!logger || !logger.buffer) {
|
||||||
|
this.bodyLogs.innerHTML = '<div style="padding:8px;color:#f59e0b;">Logger not initialized yet...</div>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const rows = logger.buffer.slice(-80);
|
||||||
|
if (rows.length === 0) {
|
||||||
|
this.bodyLogs.innerHTML = '<div style="padding:8px;color:#94a3b8;">No logs yet. Waiting for activity...</div>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.bodyLogs.innerHTML = rows.map(e =>
|
this.bodyLogs.innerHTML = rows.map(e =>
|
||||||
`<div style="padding:4px 0;border-bottom:1px dashed #2a2a34;white-space:pre-wrap;word-break:break-word;">${e.timestamp} ${e.level.padEnd(5)} ${e.message}${e.data ? ' ' + JSON.stringify(e.data) : ''}</div>`
|
`<div style="padding:4px 0;border-bottom:1px dashed #2a2a34;white-space:pre-wrap;word-break:break-word;">${e.timestamp} ${e.level.padEnd(5)} ${e.message}${e.data ? ' ' + JSON.stringify(e.data) : ''}</div>`
|
||||||
).join('');
|
).join('');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue