mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 05:06:38 +00:00
Support grouped system log messages (#5030)
* Support grouped system log messages * Format source
This commit is contained in:
parent
aa2e632df3
commit
54739c7ccd
@ -2,9 +2,9 @@ import { HomeAssistant } from "../types";
|
|||||||
|
|
||||||
export interface LoggedError {
|
export interface LoggedError {
|
||||||
name: string;
|
name: string;
|
||||||
message: string;
|
message: [string];
|
||||||
level: string;
|
level: string;
|
||||||
source: string;
|
source: [string, number];
|
||||||
// unix timestamp in seconds
|
// unix timestamp in seconds
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
exception: string;
|
exception: string;
|
||||||
|
@ -54,7 +54,8 @@ class DialogSystemLogDetail extends LitElement {
|
|||||||
</h2>
|
</h2>
|
||||||
<paper-dialog-scrollable>
|
<paper-dialog-scrollable>
|
||||||
<p>
|
<p>
|
||||||
Logger: ${item.name}
|
Logger: ${item.name}<br />
|
||||||
|
Source: ${item.source.join(":")}
|
||||||
${integration
|
${integration
|
||||||
? html`
|
? html`
|
||||||
<br />
|
<br />
|
||||||
@ -81,11 +82,18 @@ class DialogSystemLogDetail extends LitElement {
|
|||||||
Last logged:
|
Last logged:
|
||||||
${formatSystemLogTime(item.timestamp, this.hass!.language)}
|
${formatSystemLogTime(item.timestamp, this.hass!.language)}
|
||||||
</p>
|
</p>
|
||||||
${item.message
|
${item.message.length > 1
|
||||||
? html`
|
? html`
|
||||||
<pre>${item.message}</pre>
|
<ul>
|
||||||
|
${item.message.map(
|
||||||
|
(msg) =>
|
||||||
|
html`
|
||||||
|
<li>${msg}</li>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</ul>
|
||||||
`
|
`
|
||||||
: html``}
|
: item.message[0]}
|
||||||
${item.exception
|
${item.exception
|
||||||
? html`
|
? html`
|
||||||
<pre>${item.exception}</pre>
|
<pre>${item.exception}</pre>
|
||||||
|
@ -62,7 +62,7 @@ export class SystemLogCard extends LitElement {
|
|||||||
<paper-item @click=${this._openLog} .logItem=${item}>
|
<paper-item @click=${this._openLog} .logItem=${item}>
|
||||||
<paper-item-body two-line>
|
<paper-item-body two-line>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
${item.message}
|
${item.message[0]}
|
||||||
</div>
|
</div>
|
||||||
<div secondary>
|
<div secondary>
|
||||||
${formatSystemLogTime(
|
${formatSystemLogTime(
|
||||||
@ -75,7 +75,7 @@ export class SystemLogCard extends LitElement {
|
|||||||
this.hass!.localize,
|
this.hass!.localize,
|
||||||
integrations[idx]!
|
integrations[idx]!
|
||||||
)
|
)
|
||||||
: item.source}
|
: item.source[0]}
|
||||||
(${item.level})
|
(${item.level})
|
||||||
${item.count > 1
|
${item.count > 1
|
||||||
? html`
|
? html`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user