logger

package
v0.0.0-...-a4a517a Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloseSessionCommand tells the logger to finish successfully.
	CloseSessionCommand = "close"

	// FlushCommand tells the logger to flush the currently open log files.
	FlushCommand = "flush"

	// CommandStartCommand tells the logger when a command starts. The argument is StartRequest.
	CommandStartCommand = "start-command"

	// CommandEndCommand tells the logger when a command finishes. The argument is StopRequest.
	CommandEndCommand = "end-command"
)

Variables

This section is empty.

Functions

func EndCommand

func EndCommand(exitStatus int, wantLineNumber bool, clock utils.Clock)

func MustReceiveFromLogger

func MustReceiveFromLogger(config *config.Config, acceptor func(vals []string) bool) []string

MustReceiveFromLogger reads a command (which is basically just a set of strings) from the named pipe from the logger. acceptor decides if a received command is what the caller is waiting for or not.

func MustSendToLogger

func MustSendToLogger(config *config.Config, vals []string)

MustSendToLogger writes a command (which is basically just a set of strings) to the named pipe to the logger.

func Signature

func Signature() string

Signature returns the "signature" of the zenlog executable.

func StartCommand

func StartCommand(envs string, commandLineArray []string, clock utils.Clock)

Types

type Logger

type Logger struct {
	Config *config.Config

	OuterTty string

	ForwardPipe *os.File
	ReversePipe *os.File
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(config *config.Config) *Logger

func (*Logger) Child

func (l *Logger) Child() *exec.Cmd

Child returns the child process.

func (*Logger) CleanUp

func (l *Logger) CleanUp()

func (*Logger) DoLogger

func (l *Logger) DoLogger()

Start the forwarders, and do the main loop.

func (*Logger) Master

func (l *Logger) Master() *os.File

Child returns the master tty.

func (*Logger) MustReply

func (l *Logger) MustReply(config *config.Config, vals []string)

func (*Logger) OnChildDied

func (l *Logger) OnChildDied()

func (*Logger) SendCloseRequest

func (l *Logger) SendCloseRequest()

func (*Logger) SendFlushRequest

func (l *Logger) SendFlushRequest()

func (*Logger) StartChild

func (l *Logger) StartChild()

StartChild starts a child process in a new PTY.

type StartRequest

type StartRequest struct {
	Command   logfiles.Command
	LogFiles  logfiles.LogFiles
	StartTime time.Time
}

type StopReply

type StopReply struct {
	NumLines int
}

type StopRequest

type StopRequest struct {
	ExitStatus int
	FinishTime time.Time
}

Jump to

Keyboard shortcuts

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