@fordi-org/sdn 0.0.1 → 0.0.2
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/package.json +1 -1
- package/service/logs.js +3 -2
package/package.json
CHANGED
package/service/logs.js
CHANGED
|
@@ -18,11 +18,12 @@ const formatDateTime = (date) => {
|
|
|
18
18
|
const t = `${pad(h)}:${pad(date.getMinutes())}:${pad(date.getSeconds())}${a}`;
|
|
19
19
|
return `${d} ${t}`;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const decoder = new TextDecoder();
|
|
22
22
|
export const formatJournal = (line) => {
|
|
23
23
|
const time = parseInt(line.__REALTIME_TIMESTAMP.slice(0, -3));
|
|
24
24
|
const sym = line._TRANSPORT === 'stdout' ? ' > ' : '‼> ';
|
|
25
|
-
|
|
25
|
+
const message = Array.isArray(line.MESSAGE) ? decoder.decode(new Uint8Array(line.MESSAGE)) : line.MESSAGE;
|
|
26
|
+
return `${formatDateTime(new Date(time))}${sym}${message}`;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export function journalctl() {
|