the base
This commit is contained in:
15
lib/osal/systemd/journalctl.v
Normal file
15
lib/osal/systemd/journalctl.v
Normal file
@@ -0,0 +1,15 @@
|
||||
module systemd
|
||||
|
||||
import freeflowuniverse.herolib.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
|
||||
}
|
||||
Reference in New Issue
Block a user