Documentation ¶
Overview ¶
Package logging is used by the tast executable to write informational output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { // Close deinitializes the logger, returning the terminal to its original state (if necessary). Close() error // Log formats args using default formatting and logs them unconditionally and permanently (i.e. // the message will remain in the terminal's scrollback buffer). Log(args ...interface{}) // Logf is similar to Log but formats args as per fmt.Sprintf. Logf(format string, args ...interface{}) // Debug formats args using default formatting and prints a message that may be omitted in // non-verbose modes or only displayed onscreen for a short period of time. Debug(args ...interface{}) // Debugf is similar to Debug but formats args as per fmt.Sprintf. Debugf(format string, args ...interface{}) // Status updates a transient status message describing the current state of execution. Some // implementations may not display these messages. Status(msg string) // AddWriter adds an additional writer to which Log, Logf, Debug, and Debugf's messages are // logged (regardless of any verbosity settings). // flag contains logging properties to be passed to log.New. // An error is returned if w has already been added. AddWriter(w io.Writer, flag int) error // RemoveWriter stops logging to a writer previously passed to AddWriter. // An error is returned if w was not previously added. RemoveWriter(w io.Writer) error }
Logger is the interface used for logging by the tast executable.
func FromContext ¶
FromContext returns the Logger value stored in ctx, if any.
func NewDiscard ¶
func NewDiscard() Logger
NewDiscard is a convencience function that returns a Logger that discards all messages.
func NewFancy ¶
NewFancy returns an implementation of the Logger interface that renders messages onscreen using ANSI escape codes to create multiple scrolling regions (e.g. a limited number of debug messages remain onscreen).
Click to show internal directories.
Click to hide internal directories.