Documentation
¶
Index ¶
- Constants
- Variables
- func LooksLikeDataIncludedLine(envelope any) bool
- func LooksLikeEmbeddedDataIncludedLine(envelope any) bool
- func LooksLikeErrorLine(envelope any) bool
- func LooksLikeExtraAttributesLine(envelope any) bool
- type Error
- type ErrorLine
- type Level
- type LineEnvelope
- func (e *LineEnvelope) Component() string
- func (e *LineEnvelope) GetEmbeddedData() (json.RawMessage, error)
- func (e *LineEnvelope) Kind() common.Type
- func (e *LineEnvelope) Level() common.LogLevel
- func (e *LineEnvelope) Message() string
- func (e *LineEnvelope) TimeStampString() string
- func (e *LineEnvelope) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( TRACE = 10 DEBUG = 20 INFO = 30 WARN = 40 ERROR = 50 FATAL = 60 )
Variables ¶
View Source
var ErrFieldsMissing = errors.New("could not convert line type due to missing fields")
Functions ¶
func LooksLikeErrorLine ¶
Types ¶
type ErrorLine ¶
type ErrorLine struct {
Version int
LogLevel *Level
Name string
Hostname string
Pid int
Time rfc3339.DateTime
LogMessage string
SourceComponent string
Error Error
}
func EnvelopeToError ¶
func EnvelopeToError(envelope LineEnvelope) ErrorLine
type Level ¶
type Level struct {
// contains filtered or unexported fields
}
func (*Level) UnmarshalJSON ¶
type LineEnvelope ¶
type LineEnvelope struct {
Version int `json:"v"`
LogLevel *Level `json:"level"`
Name string `json:"name"`
Hostname string `json:"hostname"`
Pid int `json:"pid"`
Time rfc3339.DateTime `json:"time"`
LogMessage string `json:"msg"`
SourceComponent string `json:"component,omitempty"`
OtherFields map[string]any `json:"-"`
}
func (*LineEnvelope) Component ¶
func (e *LineEnvelope) Component() string
func (*LineEnvelope) GetEmbeddedData ¶
func (e *LineEnvelope) GetEmbeddedData() (json.RawMessage, error)
func (*LineEnvelope) Kind ¶
func (e *LineEnvelope) Kind() common.Type
func (*LineEnvelope) Level ¶
func (e *LineEnvelope) Level() common.LogLevel
func (*LineEnvelope) Message ¶
func (e *LineEnvelope) Message() string
func (*LineEnvelope) TimeStampString ¶
func (e *LineEnvelope) TimeStampString() string
func (*LineEnvelope) UnmarshalJSON ¶
func (e *LineEnvelope) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.