Documentation
¶
Index ¶
- type Client
- func (c *Client) Debug(args ...any) *Event
- func (c *Client) Debugf(v string, args ...any) *Event
- func (c *Client) Error(args ...any) *Event
- func (c *Client) Errorf(v string, args ...any) *Event
- func (c *Client) Fatal(args ...any) *Event
- func (c *Client) Fatalf(v string, args ...any) *Event
- func (c *Client) Info(args ...any) *Event
- func (c *Client) Infof(v string, args ...any) *Event
- func (c *Client) Panic(args ...any) *Event
- func (c *Client) Panicf(v string, args ...any) *Event
- func (c *Client) Trace(args ...any) *Event
- func (c *Client) Tracef(v string, args ...any) *Event
- func (c *Client) Warn(args ...any) *Event
- func (c *Client) Warnf(v string, args ...any) *Event
- func (c *Client) WithLevel(level Level) *Client
- func (c *Client) WithObserver(o ...*Observer) *Client
- func (c *Client) WithStandardLogger() *Client
- type Event
- func Debug(args ...any) *Event
- func Debugf(v string, args ...any) *Event
- func Error(args ...any) *Event
- func Errorf(v string, args ...any) *Event
- func Fatal(args ...any) *Event
- func Fatalf(v string, args ...any) *Event
- func Info(args ...any) *Event
- func Infof(v string, args ...any) *Event
- func Panic(args ...any) *Event
- func Panicf(v string, args ...any) *Event
- func Trace(args ...any) *Event
- func Tracef(v string, args ...any) *Event
- func Warn(args ...any) *Event
- func Warnf(v string, args ...any) *Event
- func (e *Event) Debug(args ...any) *Event
- func (e *Event) Debugf(v string, args ...any) *Event
- func (e *Event) E(hold ...bool) *Event
- func (e *Event) Emit(hold ...bool) *Event
- func (e *Event) Error(args ...any) *Event
- func (e *Event) Errorf(v string, args ...any) *Event
- func (e *Event) Evict()
- func (e *Event) F(k string, v any) *Event
- func (e *Event) Fatal(args ...any) *Event
- func (e *Event) Fatalf(v string, args ...any) *Event
- func (e *Event) Field(k string, v any) *Event
- func (e *Event) Fields(fields Fields) *Event
- func (e *Event) Fs(fields Fields) *Event
- func (e *Event) ID() string
- func (e *Event) Info(args ...any) *Event
- func (e *Event) Infof(v string, args ...any) *Event
- func (e *Event) Level(level Level) *Event
- func (e *Event) M(args ...any) *Event
- func (e *Event) Message(args ...any) *Event
- func (e *Event) Messagef(f string, args ...any) *Event
- func (e *Event) Mf(f string, args ...any) *Event
- func (e *Event) P(id string) *Event
- func (e *Event) Panic(args ...any) *Event
- func (e *Event) Panicf(v string, args ...any) *Event
- func (e *Event) ParentID(id string) *Event
- func (e *Event) String() string
- func (e *Event) T(topic string) *Event
- func (e *Event) Topic(topic string) *Event
- func (e *Event) Trace(args ...any) *Event
- func (e *Event) Tracef(v string, args ...any) *Event
- func (e *Event) Warn(args ...any) *Event
- func (e *Event) Warnf(v string, args ...any) *Event
- func (e *Event) WithError(err error) *Event
- type Fields
- type Level
- type Observer
- type ObserverCondition
- type ObserverHandler
- type Option
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 (*Client) Debug ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) WithObserver ¶
func (*Client) WithStandardLogger ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func Debug ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) Fatal ¶
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 ¶
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) Info ¶
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 ¶
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) Panic ¶
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 ¶
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) Trace ¶
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 ¶
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 ¶
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.
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 )
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 ObserverHandler ¶
type ObserverHandler func(*Event)