(message)
| 1 | function logMessage(message) { |
| 2 | const logContainer = document.getElementById('observer'); |
| 3 | const logEntry = document.createElement('div'); |
| 4 | logEntry.className = 'log-entry'; |
| 5 | logEntry.textContent = message; |
| 6 | |
| 7 | logContainer.appendChild(logEntry); |
| 8 | |
| 9 | // Ensure we only keep the last 10 log entries |
| 10 | while (logContainer.children.length > 10) { |
| 11 | logContainer.removeChild(logContainer.firstChild); |
| 12 | } |
| 13 | |
| 14 | // Scroll to the bottom of the log |
| 15 | logContainer.scrollTop = logContainer.scrollHeight; |
| 16 | } |
| 17 | |
| 18 | const callback = async (records, observer) => { |
| 19 | const icons = { |
no test coverage detected