Documentation
¶
Overview ¶
Package log contains log parsers for output of subprocesses
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggerFor ¶
GetLoggerFor creates (if necessary) and returns a logger for a log parser of name 'name'
Types ¶
type BaseLogParser ¶
type BaseLogParser struct {
// contains filtered or unexported fields
}
BaseLogParser provides utilities often needed to implement log parsers, that is line reassembly functionality
func NewBaseLogParser ¶
func NewBaseLogParser(lineHandler LineHandlerFunc, name string) *BaseLogParser
NewBaseLogParser creates a new log parser that uses the provided line handler and a logger 'name'
func (*BaseLogParser) HandleData ¶
func (lp *BaseLogParser) HandleData(data []byte) error
HandleData is invoked for each new buffer of data, see docs of interface type
func (*BaseLogParser) SetLevel ¶
func (lp *BaseLogParser) SetLevel(level logrus.Level)
type ETCDLogParser ¶
type ETCDLogParser struct { // Base ref BaseLogParser }
ETCDLogParser handles etcd-like log output
func NewETCDLogParser ¶
func NewETCDLogParser() *ETCDLogParser
NewETCDLogParser creates a ETCDLogParser
type KubeLogParser ¶
type KubeLogParser struct { // Base ref BaseLogParser // contains filtered or unexported fields }
KubeLogParser handles kubernetes-like log output
func NewKubeLogParser ¶
func NewKubeLogParser(app string) *KubeLogParser
NewKubeLogParser creates a KubeLogParser for the application named by 'app'
type LineHandlerFunc ¶
LineHandlerFunc describes a function that is able to consume a log line
type Parser ¶
type Parser interface { // HandleData takes all necessary actions with the provided buffer HandleData(data []byte) error }
Parser is the interface type of all log-parsing classes in this package. A Parser is used to handle the output of child processes and re-log it using the logger of the main process, unifying all logs into a single log with a coherent structure