Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = &HandlerOptions{ SortLongest: true, SkipUnchanged: true, Truncates: true, LightBg: false, TruncateLength: 15, KeyRGB: RGB{1, 108, 89}, ValRGB: RGB{125, 125, 125}, TimeFormat: time.Stamp, }
Functions ¶
Types ¶
type Handler ¶
type Handler interface { CanHandle(line []byte) bool Prettify(skipUnchanged bool) []byte logfmt.Handler }
Handler can recognize it's log lines, parse them and prettify them.
type HandlerOptions ¶
type HandlerOptions struct { Skip map[string]struct{} Keep map[string]struct{} SortLongest bool SkipUnchanged bool Truncates bool LightBg bool TruncateLength int KeyRGB RGB ValRGB RGB TimeFormat string }
func (*HandlerOptions) SetKeep ¶
func (h *HandlerOptions) SetKeep(keep []string)
func (*HandlerOptions) SetSkip ¶
func (h *HandlerOptions) SetSkip(skip []string)
type JSONHandler ¶
type JSONHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string // contains filtered or unexported fields }
JSONHandler can handle logs emmited by logrus.TextFormatter loggers.
func (*JSONHandler) Prettify ¶
func (h *JSONHandler) Prettify(skipUnchanged bool) []byte
Prettify the output in a logrus like fashion.
func (*JSONHandler) TryHandle ¶
func (h *JSONHandler) TryHandle(d []byte) bool
TryHandle tells if this line was handled by this handler.
func (*JSONHandler) UnmarshalJSON ¶
func (h *JSONHandler) UnmarshalJSON(data []byte) error
UnmarshalJSON sets the fields of the handler.
type LogrusHandler ¶
type LogrusHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string // contains filtered or unexported fields }
LogrusHandler can handle logs emmited by logrus.TextFormatter loggers.
func (*LogrusHandler) CanHandle ¶
func (h *LogrusHandler) CanHandle(d []byte) bool
CanHandle tells if this line can be handled by this handler.
func (*LogrusHandler) Prettify ¶
func (h *LogrusHandler) Prettify(skipUnchanged bool) []byte
Prettify the output in a logrus like fashion.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.