diff --git a/systemd/emulation.go b/systemd/emulation.go index addae88cc50..db451dd87ce 100644 --- a/systemd/emulation.go +++ b/systemd/emulation.go @@ -238,3 +238,7 @@ func (s *emulation) Umount(whatOrWhere string) error { func (s *emulation) Run(command []string, opts *RunOptions) ([]byte, error) { return nil, ¬ImplementedError{"Run"} } + +func (s *emulation) SetLogLevel(logLevel string) error { + return ¬ImplementedError{"SetLogLevel"} +} diff --git a/systemd/systemd.go b/systemd/systemd.go index ea2b0d584a5..d2ccf50bec3 100644 --- a/systemd/systemd.go +++ b/systemd/systemd.go @@ -440,6 +440,8 @@ type Systemd interface { CurrentTasksCount(unit string) (uint64, error) // Run a command Run(command []string, opts *RunOptions) ([]byte, error) + // Set log level for the system + SetLogLevel(logLevel string) error } // KeyringMode describes how the kernel keyring is setup, see systemd.exec(5) @@ -1745,3 +1747,8 @@ func (s *systemd) Run(command []string, opts *RunOptions) ([]byte, error) { } return stdout, nil } + +func (s *systemd) SetLogLevel(logLevel string) error { + _, err := s.systemctl("log-level", logLevel) + return err +}