Display filename and milliseconds in timestamp on the logs admin UI (#2280)

This commit is contained in:
Sávio Ribeiro 2025-02-06 02:44:24 -03:00 committed by GitHub
parent ad162c259a
commit 2f5ab4c619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -973,11 +973,12 @@ section.analytics {
margin-bottom: 2px;
}
.timestamp {
.timestamp, .file {
color: $primary;
display: inline-block;
min-width: 175px;
margin-right: 5px;
user-select: auto;
}
.line:hover {

View file

@ -4,7 +4,8 @@
<div class="lines" ref="lines">
<template v-for="(l, i) in lines">
<span :set="line = splitLine(l)" :key="i" class="line">
<span class="timestamp" :title="line.file">{{ line.timestamp }}</span>
<span class="timestamp">{{ line.timestamp }}&nbsp;</span>
<span class="file">{{ line.file }}:&nbsp;</span>
<span class="log-message">{{ line.message }}</span>
</span>
</template>
@ -15,8 +16,8 @@
<script>
// Regexp for splitting log lines in the following format to
// [timestamp] [file] [message].
// 2021/05/01 00:00:00 init.go:99: reading config: config.toml
const reFormatLine = /^([0-9\s:/]+) (.+?\.go:[0-9]+):\s/g;
// 2021/05/01 00:00:00:00 init.go:99: reading config: config.toml
const reFormatLine = /^([0-9\s:/]+\.[0-9]{6}) (.+?\.go:[0-9]+):\s(.+)$/;
export default {
name: 'LogView',