Documentation ¶
Index ¶
- func FormatIdentity(name string, description string) string
- type IdentifiableError
- type Logger
- func (l Logger) Body(a ...interface{})
- func (l Logger) BodyWriter() io.Writer
- func (l Logger) Bodyf(format string, a ...interface{})
- func (l Logger) Header(a ...interface{})
- func (l Logger) HeaderWriter() io.Writer
- func (l Logger) Headerf(format string, a ...interface{})
- func (l Logger) IsBodyEnabled() bool
- func (l Logger) IsHeaderEnabled() bool
- func (l Logger) IsTerminalErrorEnabled() bool
- func (l Logger) IsTitleEnabled() bool
- func (l Logger) TerminalError(err IdentifiableError)
- func (l Logger) TerminalErrorWriter() io.Writer
- func (l Logger) Title(buildpack libcnb.Buildpack)
- func (l Logger) TitleWriter() io.Writer
- type Option
- type Writer
- type WriterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIdentity ¶ added in v1.8.0
FormatIdentity formats a name and an optional description in the form '<b>name</b>[ description]'.
Types ¶
type IdentifiableError ¶
type IdentifiableError struct { // Name is the name of the identified object. Name string // Description is the description of the identified object. Description string // Err is the nested error. Err error }
IdentifiableError is an error associated with an Identifiable for logging purposes.
func (IdentifiableError) Error ¶
func (i IdentifiableError) Error() string
type Logger ¶
Logger logs message to a writer.
func NewLogger ¶
NewLogger creates a new instance of Logger. It configures debug logging if $BP_DEBUG is set.
func NewLoggerWithOptions ¶
NewLoggerWithOptions create a new instance of Logger. It configures the Logger with options.
func (Logger) Body ¶
func (l Logger) Body(a ...interface{})
Body formats using the default formats for its operands and logs a message to the configured body writer. Spaces are added between operands when neither is a string.
func (Logger) BodyWriter ¶
BodyWriter returns the configured body writer.
func (Logger) Bodyf ¶ added in v1.20.0
Bodyf formats according to a format specifier and logs a message to the configured body writer.
func (Logger) Header ¶
func (l Logger) Header(a ...interface{})
Header formats using the default formats for its operands and logs a message to the configured header writer. Spaces are added between operands when neither is a string.
func (Logger) HeaderWriter ¶
HeaderWriter returns the configured header writer.
func (Logger) Headerf ¶ added in v1.20.0
Headerf formats according to a format specifier and logs a message to the configured header writer.
func (Logger) IsBodyEnabled ¶
IsBodyEnabled indicates whether body logging is enabled.
func (Logger) IsHeaderEnabled ¶
IsHeaderEnabled indicates whether header logging is enabled.
func (Logger) IsTerminalErrorEnabled ¶
IsTerminalErrorEnabled indicates whether terminal error logging is enabled.
func (Logger) IsTitleEnabled ¶
IsTitleEnabled indicates whether title logging is enabled.
func (Logger) TerminalError ¶
func (l Logger) TerminalError(err IdentifiableError)
TerminalError logs a message to the configured terminal error writer.
func (Logger) TerminalErrorWriter ¶
TerminalErrorWriter returns the configured terminal error writer.
func (Logger) TitleWriter ¶
TitleWriter returns the configured title writer.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is an object that will indent and color all output flowing through it.
type WriterOption ¶
WriterOption is a function for configuring a Writer instance.
func WithAttributes ¶
func WithAttributes(attributes ...color.Attribute) WriterOption
WithAttributes creates an WriterOption that sets the output color.
func WithIndent ¶
func WithIndent(indent int) WriterOption
WithIndent creates an WriterOption that sets the depth of the output indent.