Support grouped system log messages (#5030)

* Support grouped system log messages

* Format source
This commit is contained in:
Paulus Schoutsen 2020-03-03 13:55:26 -08:00 committed by GitHub
parent aa2e632df3
commit 54739c7ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

View File

@ -2,9 +2,9 @@ import { HomeAssistant } from "../types";
export interface LoggedError {
name: string;
message: string;
message: [string];
level: string;
source: string;
source: [string, number];
// unix timestamp in seconds
timestamp: number;
exception: string;

View File

@ -54,7 +54,8 @@ class DialogSystemLogDetail extends LitElement {
</h2>
<paper-dialog-scrollable>
<p>
Logger: ${item.name}
Logger: ${item.name}<br />
Source: ${item.source.join(":")}
${integration
? html`
<br />
@ -81,11 +82,18 @@ class DialogSystemLogDetail extends LitElement {
Last logged:
${formatSystemLogTime(item.timestamp, this.hass!.language)}
</p>
${item.message
${item.message.length > 1
? html`
<pre>${item.message}</pre>
<ul>
${item.message.map(
(msg) =>
html`
<li>${msg}</li>
`
)}
</ul>
`
: html``}
: item.message[0]}
${item.exception
? html`
<pre>${item.exception}</pre>

View File

@ -62,7 +62,7 @@ export class SystemLogCard extends LitElement {
<paper-item @click=${this._openLog} .logItem=${item}>
<paper-item-body two-line>
<div class="row">
${item.message}
${item.message[0]}
</div>
<div secondary>
${formatSystemLogTime(
@ -75,7 +75,7 @@ export class SystemLogCard extends LitElement {
this.hass!.localize,
integrations[idx]!
)
: item.source}
: item.source[0]}
(${item.level})
${item.count > 1
? html`