mirror of
https://github.com/knadh/listmonk.git
synced 2025-10-06 13:26:17 +08:00
Display filename and milliseconds in timestamp on the logs admin UI (#2280)
This commit is contained in:
parent
ad162c259a
commit
2f5ab4c619
2 changed files with 6 additions and 4 deletions
|
@ -973,11 +973,12 @@ section.analytics {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timestamp {
|
.timestamp, .file {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 175px;
|
min-width: 175px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
user-select: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.line:hover {
|
.line:hover {
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
<div class="lines" ref="lines">
|
<div class="lines" ref="lines">
|
||||||
<template v-for="(l, i) in lines">
|
<template v-for="(l, i) in lines">
|
||||||
<span :set="line = splitLine(l)" :key="i" class="line">
|
<span :set="line = splitLine(l)" :key="i" class="line">
|
||||||
<span class="timestamp" :title="line.file">{{ line.timestamp }}</span>
|
<span class="timestamp">{{ line.timestamp }} </span>
|
||||||
|
<span class="file">{{ line.file }}: </span>
|
||||||
<span class="log-message">{{ line.message }}</span>
|
<span class="log-message">{{ line.message }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -15,8 +16,8 @@
|
||||||
<script>
|
<script>
|
||||||
// Regexp for splitting log lines in the following format to
|
// Regexp for splitting log lines in the following format to
|
||||||
// [timestamp] [file] [message].
|
// [timestamp] [file] [message].
|
||||||
// 2021/05/01 00:00:00 init.go:99: reading config: config.toml
|
// 2021/05/01 00:00:00:00 init.go:99: reading config: config.toml
|
||||||
const reFormatLine = /^([0-9\s:/]+) (.+?\.go:[0-9]+):\s/g;
|
const reFormatLine = /^([0-9\s:/]+\.[0-9]{6}) (.+?\.go:[0-9]+):\s(.+)$/;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LogView',
|
name: 'LogView',
|
||||||
|
|
Loading…
Add table
Reference in a new issue