Documentation ¶
Index ¶
- func New(l log.Interface) *discordLogger
- type EventStream
- func (es *EventStream) Debug(msg string)
- func (es *EventStream) Debugf(msg string, v ...any)
- func (es *EventStream) Error(msg string)
- func (es *EventStream) Errorf(msg string, v ...any)
- func (es *EventStream) Guild(dg *disgord.Guild) *EventStream
- func (es *EventStream) GuildID(gid string) *EventStream
- func (es *EventStream) Info(msg string)
- func (es *EventStream) Infof(msg string, v ...any)
- func (es *EventStream) Warn(msg string)
- func (es *EventStream) Warnf(msg string, v ...any)
- func (es *EventStream) WithError(err error) *EventStream
- func (es *EventStream) WithField(key string, value any) *EventStream
- func (es *EventStream) WithFields(fields log.Fields) *EventStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
func NewEventStream ¶
func NewEventStream(ctx context.Context, l log.Interface, db *ent.Client, flushInterval time.Duration) *EventStream
NewEventStream returns a new EventStream for streaming guild logs/events to the database with appropriate annotations. The events will be flushed at the interval defined by flushInterval.
When the context provided to the event stream is cancelled, the event stream will close its worker and any pending events will be dropped (too lazy to bother).
func (*EventStream) Debug ¶
func (es *EventStream) Debug(msg string)
func (*EventStream) Debugf ¶
func (es *EventStream) Debugf(msg string, v ...any)
func (*EventStream) Error ¶
func (es *EventStream) Error(msg string)
func (*EventStream) Errorf ¶
func (es *EventStream) Errorf(msg string, v ...any)
func (*EventStream) Guild ¶
func (es *EventStream) Guild(dg *disgord.Guild) *EventStream
Guild annotates a new event with the guild information.
func (*EventStream) GuildID ¶
func (es *EventStream) GuildID(gid string) *EventStream
GuildID annotates a new event with the guild information.
func (*EventStream) Info ¶
func (es *EventStream) Info(msg string)
func (*EventStream) Infof ¶
func (es *EventStream) Infof(msg string, v ...any)
func (*EventStream) Warn ¶
func (es *EventStream) Warn(msg string)
func (*EventStream) Warnf ¶
func (es *EventStream) Warnf(msg string, v ...any)
func (*EventStream) WithError ¶
func (es *EventStream) WithError(err error) *EventStream
WithError annotates a new event with the provided error.
func (*EventStream) WithField ¶
func (es *EventStream) WithField(key string, value any) *EventStream
WithField annotates a new event with the provided field.
func (*EventStream) WithFields ¶
func (es *EventStream) WithFields(fields log.Fields) *EventStream
WithFields annotates a new event with the provided fields.
Click to show internal directories.
Click to hide internal directories.