cage

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cage copies all output to stdout, stderr and log output in a logfile.

Usage: cage.Name = cage.DefaultLogfileName cage.Enable() defer cage.Disable() do stuff...

Index

Constants

This section is empty.

Variables

View Source
var (
	// Verbose gives mor information on output if set. The value is injected from main packages.
	Verbose bool

	// DefaultLogfileName is the pattern for default logfile name. The timestamp is replaced with the actual time.
	DefaultLogfileName = "2006-01-02_1504-05_cage.log"

	// Name is the filename of the logfile. "off" inhibits logfile writing.
	Name = "off"
)

Functions

func Disable

func Disable()

Disable ends take notes mode, means parallel writing into a file. It takes no effect when pContainer is nil, what is the case when Enable was started with "off" or "none" as 'Name'.

func Enable

func Enable()

Enable starts take notes mode, means parallel writing into a file. Name has to be assigned to a value other than "off" or "none" for taking effect.

func Stop

func Stop(c *Container)

Stop does return to normal state.

Types

type Container

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

Container keeps re-direction informantion for restoring

func Start

func Start(fn string) *Container

Start does append all output parallel into a logfile with name fn

Jump to

Keyboard shortcuts

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