next-issue 14.6.0 → 14.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/render.mjs +8 -3
- package/package.json +1 -1
package/dist/shared/render.mjs
CHANGED
|
@@ -2,11 +2,16 @@ import { truncate } from './text.mjs';
|
|
|
2
2
|
export function render(record) {
|
|
3
3
|
const time = new Date(String(record.ts)).toTimeString().slice(0, 8);
|
|
4
4
|
const issue = record.issue === undefined ? '' : ` #${record.issue}`;
|
|
5
|
+
const role = record.role === undefined ? '' : `${String(record.role)}.`;
|
|
6
|
+
const kind = String(record.kind);
|
|
5
7
|
const extras = Object.entries(record)
|
|
6
|
-
.filter(([key]) => !['ts', 'runId', 'kind', 'issue'].includes(key))
|
|
7
|
-
.map(([key, value]) => `${key}=${key === 'command' ? oneLine(value) : short(value)}`)
|
|
8
|
+
.filter(([key]) => !['ts', 'runId', 'kind', 'issue', 'role'].includes(key))
|
|
9
|
+
.map(([key, value]) => `${label(kind, key)}=${key === 'command' ? oneLine(value) : short(value)}`)
|
|
8
10
|
.join(' ');
|
|
9
|
-
return `${time}${issue} ${
|
|
11
|
+
return `${time}${issue} ${role}${kind}${extras.length > 0 ? ` ${extras}` : ''}\n`;
|
|
12
|
+
}
|
|
13
|
+
function label(kind, key) {
|
|
14
|
+
return key === 'tool' && (kind === 'tool' || kind === 'tool.error') ? 'name' : key;
|
|
10
15
|
}
|
|
11
16
|
function short(value) {
|
|
12
17
|
if (value === undefined || value === null) {
|