Documentation ¶
Index ¶
- func DescribeObject(obj interface{}) string
- func FormatLogLine(text string, unwrapperMap map[LogType]Unwrapper, ...) (string, error)
- func FormatValue(val interface{}) string
- func NiceMap(params map[string]interface{}) string
- type ColorizerFunc
- type Formatter
- type LogEntry
- type LogType
- type Param
- type Unwrapper
- type UnwrapperFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeObject ¶
func DescribeObject(obj interface{}) string
func FormatLogLine ¶
func FormatValue ¶
func FormatValue(val interface{}) string
Types ¶
type ColorizerFunc ¶
type Formatter ¶
type Formatter interface { // Format takes JSON bytes that represents a single log entry and returns the human-readable version. Format(lineJSON []byte) (string, error) // RawTemplate returns the raw template string for this formatter. RawTemplate() string // TemplateObjectDescription returns the description of the object that is expected to be provided to the // template function for this formatter. Empty string indicates that there is no suitable description. TemplateObjectDescription() string }
type Param ¶
type Param interface {
// contains filtered or unexported methods
}
func Colorizer ¶
func Colorizer(c ColorizerFunc) Param
func NoSubstitution ¶
func NoSubstitution() Param
NoSubstitution configures the formatter in a mode that specifies that no substitution should be performed.
type Unwrapper ¶
An Unwrapper unwraps a line of JSON, returning the underlying log entry's contents.
type UnwrapperFunc ¶
The UnwrapperFunc type is an adapter to allow the use of ordinary functions as Unwrappers. If f is a function with the appropriate signature, UnwrapperFunc(f) is an Unwrapper that calls f.
func (UnwrapperFunc) UnwrapLogLine ¶
func (f UnwrapperFunc) UnwrapLogLine(lineJSON []byte) ([]byte, error)
UnwrapLogLine calls f(lineJSON).
Click to show internal directories.
Click to hide internal directories.