-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-log-viewer.html
More file actions
54 lines (48 loc) · 1.74 KB
/
test-log-viewer.html
File metadata and controls
54 lines (48 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCP Logger Test</title>
</head>
<body>
<h1>MCP Logger Test Page</h1>
<button onclick="generateLogs()">Generate Test Logs</button>
<button onclick="clearLogs()">Clear Logs</button>
<div id="status"></div>
<script>
// Configure MCP Logger
window.MCP_LOGGING_ENABLED = true;
window.MCP_LOGGING_APP_NAME = 'test-app';
window.MCP_LOGGING_BACKEND_URL = 'http://localhost:22345';
</script>
<script src="http://localhost:22345/mcp-logger.js"></script>
<script>
function generateLogs() {
console.log('Test log message from test page');
console.warn('Warning message from test page');
console.error('Error message from test page');
console.info('Info message from test page');
// Application log
if (window.logger) {
logger.log('user-actions', {
action: 'button-click',
timestamp: Date.now(),
data: { button: 'generate-logs' }
});
}
document.getElementById('status').textContent = 'Logs generated at ' + new Date().toLocaleTimeString();
}
function clearLogs() {
console.clear();
document.getElementById('status').textContent = 'Console cleared';
}
// Auto-generate logs every 5 seconds for testing
setInterval(() => {
if (Math.random() > 0.7) {
console.log('Auto-generated log at ' + new Date().toLocaleTimeString());
}
}, 5000);
</script>
</body>
</html>