Skip to content

Commit 2f5ab4c

Browse files
authored
Display filename and milliseconds in timestamp on the logs admin UI (#2280)
1 parent ad162c2 commit 2f5ab4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/assets/style.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,11 +973,12 @@ section.analytics {
973973
margin-bottom: 2px;
974974
}
975975

976-
.timestamp {
976+
.timestamp, .file {
977977
color: $primary;
978978
display: inline-block;
979979
min-width: 175px;
980980
margin-right: 5px;
981+
user-select: auto;
981982
}
982983

983984
.line:hover {

frontend/src/components/LogView.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<div class="lines" ref="lines">
55
<template v-for="(l, i) in lines">
66
<span :set="line = splitLine(l)" :key="i" class="line">
7-
<span class="timestamp" :title="line.file">{{ line.timestamp }}</span>
7+
<span class="timestamp">{{ line.timestamp }}&nbsp;</span>
8+
<span class="file">{{ line.file }}:&nbsp;</span>
89
<span class="log-message">{{ line.message }}</span>
910
</span>
1011
</template>
@@ -15,8 +16,8 @@
1516
<script>
1617
// Regexp for splitting log lines in the following format to
1718
// [timestamp] [file] [message].
18-
// 2021/05/01 00:00:00 init.go:99: reading config: config.toml
19-
const reFormatLine = /^([0-9\s:/]+) (.+?\.go:[0-9]+):\s/g;
19+
// 2021/05/01 00:00:00:00 init.go:99: reading config: config.toml
20+
const reFormatLine = /^([0-9\s:/]+\.[0-9]{6}) (.+?\.go:[0-9]+):\s(.+)$/;
2021
2122
export default {
2223
name: 'LogView',

0 commit comments

Comments
 (0)