Skip to content

Commit

Permalink
Merge pull request #1069 from skrashevich/feat(webui)-log-coloring
Browse files Browse the repository at this point in the history
feat(logging): enhance log visualisation with level-specific colours
  • Loading branch information
AlexxIT committed Apr 30, 2024
2 parents 6f1cc94 + 652dc93 commit b8b90ab
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions www/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,30 @@
height: 100%;
}





table tbody td {
font-size: 13px;
vertical-align: top;
}


.info {
color: #0174DF;
}

.debug {
color: #808080;
}

.error {
color: #DF0101;
}

.trace {
color: #585858;
}

.warn {
color: #FF9966;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -89,7 +102,7 @@
const msg = Object.keys(line).reduce((msg, key) => {
return KEYS.indexOf(key) < 0 ? `${msg} ${key}=${line[key]}` : msg;
}, line['message']);
return `<tr><td>${ts.toLocaleString()}</td><td>${line['level']}</td><td>${escapeHTML(msg)}</td></tr>`;
return `<tr class="${line['level']}"><td>${ts.toLocaleString()}</td><td>${escapeHTML(line['level'])}</td><td>${escapeHTML(msg)}</td></tr>`;
}).join('');
}

Expand Down

0 comments on commit b8b90ab

Please sign in to comment.