Files
herolib/lib/osal/systemd/journalctl.v
2025-07-21 06:18:46 +02:00

16 lines
426 B
V

module systemd
import freeflowuniverse.herolib.osal.core as osal
pub struct JournalArgs {
pub:
service string // name of service for which logs will be retrieved
limit int = 100 // number of last log lines to be shown
}
pub fn journalctl(args JournalArgs) !string {
cmd := 'journalctl --no-pager -n ${args.limit} -u ${name_fix(args.service)}'
response := osal.execute_silent(cmd) or { return err }
return response
}