skylight

package module
v0.0.0-...-922e804 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Default

func Default() *Client

func New

func New(opts ...Option) *Client

func (*Client) Debug

func (c *Client) Debug(args ...any) *Event

Debug creates a new event with the debug level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Debugf

func (c *Client) Debugf(v string, args ...any) *Event

Debugf creates a new event with the debug level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Error

func (c *Client) Error(args ...any) *Event

Error creates a new event with the error level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Errorf

func (c *Client) Errorf(v string, args ...any) *Event

Errorf creates a new event with the error level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Fatal

func (c *Client) Fatal(args ...any) *Event

Fatal creates a new event with the fatal level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Fatalf

func (c *Client) Fatalf(v string, args ...any) *Event

Fatalf creates a new event with the fatal level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Info

func (c *Client) Info(args ...any) *Event

Info creates a new event with the info level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Infof

func (c *Client) Infof(v string, args ...any) *Event

Infof creates a new event with the info level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Panic

func (c *Client) Panic(args ...any) *Event

Panic creates a new event with the panic level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Panicf

func (c *Client) Panicf(v string, args ...any) *Event

Panicf creates a new event with the panic level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Trace

func (c *Client) Trace(args ...any) *Event

Trace creates a new event with the trace level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Tracef

func (c *Client) Tracef(v string, args ...any) *Event

Tracef creates a new event with the trace level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) Warn

func (c *Client) Warn(args ...any) *Event

Warn creates a new event with the warn level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func (*Client) Warnf

func (c *Client) Warnf(v string, args ...any) *Event

Warnf creates a new event with the warn level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Client) WithLevel

func (c *Client) WithLevel(level Level) *Client

func (*Client) WithObserver

func (c *Client) WithObserver(o ...*Observer) *Client

func (*Client) WithStandardLogger

func (c *Client) WithStandardLogger() *Client

type Event

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

func Debug

func Debug(args ...any) *Event

Debug creates a new event with the debug level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Debugf

func Debugf(v string, args ...any) *Event

Debugf creates a new event with the debug level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Error

func Error(args ...any) *Event

Error creates a new event with the error level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Errorf

func Errorf(v string, args ...any) *Event

Errorf creates a new event with the error level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Fatal

func Fatal(args ...any) *Event

Fatal creates a new event with the fatal level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Fatalf

func Fatalf(v string, args ...any) *Event

Fatalf creates a new event with the fatal level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Info

func Info(args ...any) *Event

Info creates a new event with the info level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Infof

func Infof(v string, args ...any) *Event

Infof creates a new event with the info level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Panic

func Panic(args ...any) *Event

Panic creates a new event with the panic level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Panicf

func Panicf(v string, args ...any) *Event

Panicf creates a new event with the panic level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Trace

func Trace(args ...any) *Event

Trace creates a new event with the trace level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Tracef

func Tracef(v string, args ...any) *Event

Tracef creates a new event with the trace level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func Warn

func Warn(args ...any) *Event

Warn creates a new event with the warn level and associates it with the client. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new event.

func Warnf

func Warnf(v string, args ...any) *Event

Warnf creates a new event with the warn level and associates it with the client. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new event.

func (*Event) Debug

func (e *Event) Debug(args ...any) *Event

Debug creates a child event with the debug level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Debugf

func (e *Event) Debugf(v string, args ...any) *Event

Debugf creates a child event with the debug level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) E

func (e *Event) E(hold ...bool) *Event

E is an alias for the Emit method. Emit triggers the event, notifying all observers that match the condition. If hold is true, the event is not recycled and must be manually closed with `Evict`. Otherwise, the event is returned to the pool after emission.

func (*Event) Emit

func (e *Event) Emit(hold ...bool) *Event

Emit triggers the event, notifying all observers that match the condition. If hold is true, the event is not recycled and must be manually closed with `Evict`. Otherwise, the event is returned to the pool after emission.

func (*Event) Error

func (e *Event) Error(args ...any) *Event

Error creates a child event with the error level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Errorf

func (e *Event) Errorf(v string, args ...any) *Event

Errorf creates a child event with the error level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) Evict

func (e *Event) Evict()

func (*Event) F

func (e *Event) F(k string, v any) *Event

F is an alias for the Field method.

func (*Event) Fatal

func (e *Event) Fatal(args ...any) *Event

Fatal creates a child event with the fatal level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Fatalf

func (e *Event) Fatalf(v string, args ...any) *Event

Fatalf creates a child event with the fatal level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) Field

func (e *Event) Field(k string, v any) *Event

func (*Event) Fields

func (e *Event) Fields(fields Fields) *Event

func (*Event) Fs

func (e *Event) Fs(fields Fields) *Event

Fs is an alias for the Fields method.

func (*Event) ID

func (e *Event) ID() string

func (*Event) Info

func (e *Event) Info(args ...any) *Event

Info creates a child event with the info level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Infof

func (e *Event) Infof(v string, args ...any) *Event

Infof creates a child event with the info level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) Level

func (e *Event) Level(level Level) *Event

func (*Event) M

func (e *Event) M(args ...any) *Event

M is an alias for the Message method.

func (*Event) Message

func (e *Event) Message(args ...any) *Event

func (*Event) Messagef

func (e *Event) Messagef(f string, args ...any) *Event

func (*Event) Mf

func (e *Event) Mf(f string, args ...any) *Event

Mf is an alias for the Messagef method.

func (*Event) P

func (e *Event) P(id string) *Event

P is an alias for the ParentID method.

func (*Event) Panic

func (e *Event) Panic(args ...any) *Event

Panic creates a child event with the panic level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Panicf

func (e *Event) Panicf(v string, args ...any) *Event

Panicf creates a child event with the panic level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) ParentID

func (e *Event) ParentID(id string) *Event

func (*Event) String

func (e *Event) String() string

func (*Event) T

func (e *Event) T(topic string) *Event

T is an alias for the Topic method.

func (*Event) Topic

func (e *Event) Topic(topic string) *Event

func (*Event) Trace

func (e *Event) Trace(args ...any) *Event

Trace creates a child event with the trace level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Tracef

func (e *Event) Tracef(v string, args ...any) *Event

Tracef creates a child event with the trace level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) Warn

func (e *Event) Warn(args ...any) *Event

Warn creates a child event with the warn level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprint and assigns this message to the new child event.

func (*Event) Warnf

func (e *Event) Warnf(v string, args ...any) *Event

Warnf creates a child event with the warn level and sets the parentID to the current event's ID. It formats the provided arguments into a message using fmt.Sprintf according to the format string 'v' and assigns this message to the new child event.

func (*Event) WithError

func (e *Event) WithError(err error) *Event

type Fields

type Fields map[string]any

type Level

type Level int
const (
	// LevelNone represents no logging (no-op).
	LevelNone Level = iota

	// Very detailed logs, for deep troubleshooting.
	LevelTrace

	// Detailed logs useful during development.
	LevelDebug

	// High-level operational information.
	LevelInfo

	// Indications of potential issues.
	LevelWarn

	// Errors that prevent certain functions but not the whole application.
	LevelError

	// Severe errors causing application shutdown.
	LevelFatal

	// LevelPanic represents critical errors that cause the application to panic and terminate abruptly.
	LevelPanic
)

func (Level) String

func (l Level) String() string

type Observer

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

func LevelObserver

func LevelObserver(level Level, handler ObserverHandler) *Observer

func TopicObserver

func TopicObserver(topic string, handler ObserverHandler) *Observer

func WildcardObserver

func WildcardObserver(handler ObserverHandler) *Observer

type ObserverCondition

type ObserverCondition func(*Event) bool

type ObserverHandler

type ObserverHandler func(*Event)

type Option

type Option func(c *Client)

func WithLevel

func WithLevel(l Level) Option

func WithObserver

func WithObserver(o ...*Observer) Option

func WithStandardLogger

func WithStandardLogger() Option

Jump to

Keyboard shortcuts

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