Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChooseColor ¶
ChooseColor will return the same color based on input string.
Types ¶
type DebugLogger ¶
type DebugLogger struct { Debugf LogFn Warnf LogFn Infof LogFn Errorf LogFn // contains filtered or unexported fields }
DebugLogger is a container struct for the DebugLogger logger used to manage internal state. LogLevel is determined by log specifier coming after # character of DEBUG env var. e.g.) DEBUG=pm:cmd#i,d means prints pm:cmd logs with info & debug logs.
func NewDebugLogger ¶
func NewDebugLogger(tag string) *DebugLogger
NewDebugLogger Returns a DebugLogger logging instance. It will determine if the logger should bypass logging actions or be activated. If NO_COLOR env var is set, color output is disabled.
func (*DebugLogger) Extend ¶
func (k *DebugLogger) Extend(tag string) *DebugLogger
Extend returns a new DebugLogger logger instance that has appended the provided tag to the original logger.
New logger instance will have original `tag` value delimited with a `:` and appended with the new extended `tag` input.
Example:
k := New("test:original) k.Log("test") ke := k.Extend("plugin") ke.Log("test extended")
Output:
test:original test test:original:plugin test extended
func (*DebugLogger) Printf ¶
func (k *DebugLogger) Printf(format string, v ...interface{})
Printf is equivalent to fmt.Printf(f, pretty.Formatter(x), pretty.Formatter(y)).
func (*DebugLogger) Println ¶
func (k *DebugLogger) Println(v ...interface{})
Println is equivalent to fmt.Println(pretty.Formatter(x), pretty.Formatter(y)), but each operand is formatted with "%# v".