logging

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JournalTailer

type JournalTailer struct {
	// contains filtered or unexported fields
}

JournalTailer is an exec of the journalctl command line

func NewJournalTailer

func NewJournalTailer(unitName string, since time.Time, follow bool) (*JournalTailer, error)

NewJournalTailer instantiate a new JournalTailer. The parameter are: - unit name "example.service" - since show entries not older than the specified date - follow to enable the tailing

func (*JournalTailer) GetCommandLine added in v0.3.0

func (j *JournalTailer) GetCommandLine() string

GetCommandLine returns the command line as a single joined string

func (*JournalTailer) GetUnitName added in v0.3.0

func (j *JournalTailer) GetUnitName() string

GetUnitName is a getter to returns the unit name to display

func (*JournalTailer) IsRunning added in v0.5.0

func (j *JournalTailer) IsRunning() bool

IsRunning returns if the process and the pipe are still running

func (*JournalTailer) RestartTail added in v0.5.0

func (j *JournalTailer) RestartTail() error

RestartTail execute a StopTail and a StartTail. Basically it allows to stop and start over

func (*JournalTailer) StartTail

func (j *JournalTailer) StartTail() error

StartTail build and start the journalctl process with the adapted flags It creates a pipe to display the logs over stdout

func (*JournalTailer) StopTail

func (j *JournalTailer) StopTail() error

StopTail close the pipe, send a SIGTERM to the journalctl process and then wait its completion

func (*JournalTailer) Wait added in v0.3.0

func (j *JournalTailer) Wait() error

Wait on the journalctl process, needed to reap the process

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL