Documentation ¶
Overview ¶
Package logging implements the logger for the pack CLI.
Index ¶
- Constants
- func IsTerminal(w io.Writer) (uintptr, bool)
- func WithClock(clock func() time.Time) func(writers *LogWithWriters)
- func WithVerbose() func(writers *LogWithWriters)
- type LogWithWriters
- func (lw *LogWithWriters) HandleLog(e *log.Entry) error
- func (lw *LogWithWriters) IsVerbose() bool
- func (lw *LogWithWriters) WantQuiet(f bool)
- func (lw *LogWithWriters) WantTime(f bool)
- func (lw *LogWithWriters) WantVerbose(f bool)
- func (lw *LogWithWriters) Writer() io.Writer
- func (lw *LogWithWriters) WriterForLevel(level logging.Level) io.Writer
- type LogWriter
Constants ¶
const ( // InvalidFileDescriptor based on https://golang.org/src/os/file_unix.go?s=2183:2210#L57 InvalidFileDescriptor = ^(uintptr(0)) )
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶ added in v0.18.0
IsTerminal returns whether a writer is a terminal
func WithClock ¶ added in v0.7.0
func WithClock(clock func() time.Time) func(writers *LogWithWriters)
WithClock is an option used to initialize a LogWithWriters with a given clock function
func WithVerbose ¶ added in v0.11.0
func WithVerbose() func(writers *LogWithWriters)
WithVerbose is an option used to initialize a LogWithWriters with Verbose turned on
Types ¶
type LogWithWriters ¶ added in v0.7.0
LogWithWriters is a logger used with the pack CLI, allowing users to print logs for various levels, including Info, Debug and Error
func NewLogWithWriters ¶
func NewLogWithWriters(stdout, stderr io.Writer, opts ...func(*LogWithWriters)) *LogWithWriters
NewLogWithWriters creates a logger to be used with pack CLI.
func (*LogWithWriters) HandleLog ¶ added in v0.7.0
func (lw *LogWithWriters) HandleLog(e *log.Entry) error
HandleLog handles log events, printing entries appropriately
func (*LogWithWriters) IsVerbose ¶ added in v0.7.0
func (lw *LogWithWriters) IsVerbose() bool
IsVerbose returns whether verbose logging is on
func (*LogWithWriters) WantQuiet ¶ added in v0.7.0
func (lw *LogWithWriters) WantQuiet(f bool)
WantQuiet reduces the number of logs returned
func (*LogWithWriters) WantTime ¶ added in v0.7.0
func (lw *LogWithWriters) WantTime(f bool)
WantTime turns timestamps on in log entries
func (*LogWithWriters) WantVerbose ¶ added in v0.7.0
func (lw *LogWithWriters) WantVerbose(f bool)
WantVerbose increases the number of logs returned
func (*LogWithWriters) Writer ¶ added in v0.7.0
func (lw *LogWithWriters) Writer() io.Writer
Writer returns the base Writer for the LogWithWriters
func (*LogWithWriters) WriterForLevel ¶ added in v0.7.0
func (lw *LogWithWriters) WriterForLevel(level logging.Level) io.Writer
WriterForLevel returns a Writer for the given logging.Level
type LogWriter ¶ added in v0.12.0
LogWriter is a writer used for logs
func NewLogWriter ¶ added in v0.12.0
NewLogWriter creates a LogWriter