guildlogger

package
v0.0.0-...-d1147f9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(l log.Interface) *discordLogger

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.

Jump to

Keyboard shortcuts

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