MCPcopy Create free account
hub / github.com/GoogleChrome/samples / updateLogDisplay

Function updateLogDisplay

pwa-testing/chat-app-deep-linking/script.js:339–351  ·  view source on GitHub ↗
(logs)

Source from the content-addressed store, hash-verified

337}
338
339function updateLogDisplay(logs) {
340 const logContainer = document.getElementById("log-container");
341 logContainer.innerHTML = ""; // Clear previous logs
342 logs.reverse().forEach((log) => {
343 const logElement = createLogElement(log);
344 // logElement.classList.add('log-entry');
345 // const clientText = `Client ${log.source.substring(0, 2)}`;
346 // logElement.textContent = `${new Date(log.timestamp).toLocaleString()}, [${
347 // clientText}]: ${log.message}`;
348 // logElement.style.color = helpers.getCssColorFromHex(log.source);
349 logContainer.appendChild(logElement);
350 });
351}
352
353function updateChatDisplay(chatId, chats) {
354 log(`Updating chat display for '${chatId}' with ${chats.length} chats`);

Callers 1

script.jsFile · 0.85

Calls 1

createLogElementFunction · 0.70

Tested by

no test coverage detected