logging

package
v1.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package logging implements machine logging sink.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEvent

type LogEvent struct {
	Fields map[string]interface{}
	Time   time.Time
	Msg    string
	Level  zapcore.Level
}

LogEvent represents a log message to be send.

type LogSender

type LogSender struct {
	// contains filtered or unexported fields
}

LogSender writes zap logs to the remote destination.

func NewLogSender

func NewLogSender(endpoint *url.URL) *LogSender

NewLogSender returns log sender that sends logs in JSON over TCP (newline-delimited) or UDP (one message per packet).

func (*LogSender) Close

func (j *LogSender) Close(ctx context.Context) error

Close implements LogSender interface.

func (*LogSender) Send

func (j *LogSender) Send(ctx context.Context, e *LogEvent) error

Send implements LogSender interface.

type ZapCore

type ZapCore struct {
	// contains filtered or unexported fields
}

ZapCore wrapper for forwarding log events to the siderolink logs endpoint.

func NewZapCore

func NewZapCore(endpoint string) (*ZapCore, error)

NewZapCore creates a new zap core.

func (*ZapCore) Check

func (core *ZapCore) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry

Check implements zapcore.core interface.

func (*ZapCore) Close

func (core *ZapCore) Close(ctx context.Context) error

Close the sender.

func (*ZapCore) ConfigureInterface

func (core *ZapCore) ConfigureInterface(ctx context.Context, iface string) error

ConfigureInterface inits the sender.

func (*ZapCore) Enabled

func (core *ZapCore) Enabled(zapcore.Level) bool

Enabled implements zapcore.LevelEnabler interface.

func (*ZapCore) Sync

func (core *ZapCore) Sync() error

Sync implements zapcore.Core interface.

func (*ZapCore) With

func (core *ZapCore) With(fields []zapcore.Field) zapcore.Core

With implements zapcore.Core interface.

func (*ZapCore) Write

func (core *ZapCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

Write implements zapcore.Core interface.

Jump to

Keyboard shortcuts

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