Documentation
¶
Index ¶
- Constants
- type Log
- func (l *Log) Get(key string) (value string, ok bool)
- func (l *Log) JSON() string
- func (l *Log) JSONReader() io.Reader
- func (l *Log) Props() []Property
- func (l *Log) Reader() io.Reader
- func (l *Log) Remove(key string) (found bool)
- func (l *Log) Reset()
- func (l *Log) Set(key string, value string) (upsert bool)
- func (l *Log) String() string
- func (l *Log) Timestamp() string
- func (l *Log) WriteJSONTo(buf *bytes.Buffer)
- func (l *Log) WriteTo(buf *bytes.Buffer)
- type Parser
- type Property
Constants ¶
const ( Info string = "INFO" Debug = "DEBUG" Trace = "TRACE" Error = "ERROR" Warn = "WARN" )
const ( KeyThread = "thread" KeyClass = "class" KeyLevel = "level" KeyTime = "time" KeyDate = "date" KeyTimestamp = "timestamp" KeyMessage = "msg" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct {
Level string
Thread string
Class string
/* other properties */
Message string
// contains filtered or unexported fields
}
Log represents a structured log
func (*Log) Get ¶
Get returns a the value of key set in the log properties or ok = false if there's no value set for that key
func (*Log) JSONReader ¶
func (*Log) Props ¶
Props returns a slice of the Log arbitrary key-value properties. It does not contain any of the named properties.
func (*Log) Remove ¶
Remove will remove the passed key from the log properties. It returns true if a property with the given key was found and removed.
func (*Log) Set ¶
Set will upsert the value of passed key in the log properties. It returns false if key was not found and property was added or true if it was upserted.
func (*Log) WriteJSONTo ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser holds the state of input text parsing
func NewParser ¶
func NewParser() (p *Parser)
NewParser allocates storage for a Parser and initializes it with the given string