Skip to content

Commit

Permalink
Display filename and milliseconds in timestamp on the logs admin UI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
savioribeiro authored Feb 6, 2025
1 parent ad162c2 commit 2f5ab4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion frontend/src/assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/LogView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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',
Expand Down

0 comments on commit 2f5ab4c

Please sign in to comment.