({
follow,
lines,
}: {
follow: boolean;
lines: number;
})
| 672 | } |
| 673 | |
| 674 | async function logsDaemon({ |
| 675 | follow, |
| 676 | lines, |
| 677 | }: { |
| 678 | follow: boolean; |
| 679 | lines: number; |
| 680 | }): Promise<void> { |
| 681 | const layout = resolveDaemonLayout(); |
| 682 | if (layout.platform === 'linux') { |
| 683 | const args = ['--user', '-u', layout.systemdServiceName!, '-n', String(lines)]; |
| 684 | if (follow) { |
| 685 | args.push('-f'); |
| 686 | } |
| 687 | await runCommand('journalctl', args); |
| 688 | return; |
| 689 | } |
| 690 | |
| 691 | await printFileTail(layout.stdoutLog, lines, process.stdout, `== ${layout.stdoutLog} ==\n`); |
| 692 | await printFileTail(layout.stderrLog, lines, process.stderr, `== ${layout.stderrLog} ==\n`); |
| 693 | if (!follow) { |
| 694 | return; |
| 695 | } |
| 696 | await followLogFiles([layout.stdoutLog, layout.stderrLog]); |
| 697 | } |
| 698 | |
| 699 | async function uninstallDaemon(): Promise<void> { |
| 700 | const layout = resolveDaemonLayout(); |
no test coverage detected