Documentation ¶
Overview ¶
This package contains helpers to make the logging awesome. In particular, here you can find a pretty logger and a log tee, which outputs logs to multiple sources.
Index ¶
- func CopyToLog(log logr.Logger, r io.Reader) error
- func CopyToLogNoError(log logr.Logger, r io.Reader)
- func CopyToLogPrefix(log logr.Logger, r io.Reader, prefix string) error
- func CopyToLogPrefixNoError(log logr.Logger, r io.Reader, prefix string)
- func FancyLog(e genericr.Entry) string
- func LogClose(log logr.Logger, c io.Closer, msg string)
- type Tee
- func (t *Tee) Enabled() bool
- func (t *Tee) Error(err error, msg string, keysAndValues ...interface{})
- func (t *Tee) Info(msg string, keysAndValues ...interface{})
- func (t *Tee) V(level int) logr.Logger
- func (t *Tee) WithName(name string) logr.Logger
- func (t *Tee) WithValues(keysAndValues ...interface{}) logr.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToLogNoError ¶
CopyToLogNoError emits log entries from a reader. Any error during read will be logged.
func CopyToLogPrefix ¶
CopyToLogPrefix splits a reader by newlines and emits log entries with a prefix.
func CopyToLogPrefixNoError ¶
CopyToLogPrefixNoError emits log entries from a reader with a prefix. Any error during read will be logged.
Types ¶
type Tee ¶
type Tee struct {
// contains filtered or unexported fields
}
func (*Tee) WithValues ¶
WithValues creates a new logger with the given values set.
Click to show internal directories.
Click to hide internal directories.