v0

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 LooksLikeDataIncludedLine

func LooksLikeDataIncludedLine(envelope any) bool

func LooksLikeEmbeddedDataIncludedLine

func LooksLikeEmbeddedDataIncludedLine(envelope any) bool

func LooksLikeErrorLine

func LooksLikeErrorLine(envelope any) bool

func LooksLikeExtraAttributesLine

func LooksLikeExtraAttributesLine(envelope any) bool

Types

type Error

type Error struct {
	ErrNo   int
	Code    string
	Syscall string
	Path    string
	Stack   []string
	Message string
}

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) IsDebug

func (l *Level) IsDebug() bool

func (*Level) IsError

func (l *Level) IsError() bool

func (*Level) IsFatal

func (l *Level) IsFatal() bool

func (*Level) IsInfo

func (l *Level) IsInfo() bool

func (*Level) IsTrace

func (l *Level) IsTrace() bool

func (*Level) IsWarn

func (l *Level) IsWarn() bool

func (*Level) String

func (l *Level) String() string

func (*Level) UnmarshalJSON

func (l *Level) UnmarshalJSON(data []byte) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL