log

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package log provides utilities to collect logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector watches a file on remote host and collects the appended contents.

func StartCollector

func StartCollector(ctx context.Context, host *ssh.Conn, p string, tailFollowNameSupported bool) (*Collector, error)

StartCollector spawns a log collector on file p on host.

Set tailFollowNameSupported to true if the host's tail implementation supports the "--follow=name" command to allow for tail following to stay at the same filename rather than follow the file if the name changes.

func (*Collector) Close

func (c *Collector) Close() error

Close stops the collector.

func (*Collector) Dump

func (c *Collector) Dump(w io.Writer) error

Dump copies the contents collected to w and resets the buffer.

Jump to

Keyboard shortcuts

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