log

package
v0.0.0-...-c3d50c6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logs

type Logs struct {
	Primary     *logrus.Logger
	Command     *logrus.Entry
	Multiplexer *logrus.Entry
	// contains filtered or unexported fields
}

Logs defines all the different loggers used within the bot

func New

func New(debug bool) *Logs

New creates a new Logs stuct. Accepts a boolean specifying whether debug mode is enabled.

func (*Logs) CmdErr

func (l *Logs) CmdErr(ctx *multiplexer.Context, err error, msg string)

CmdErr is used for handling errors within commands which should be reported to the user. Takes a multiplexer context, error message, and user-readable message which are sent to the channel where the command was executed.

func (*Logs) MuxMiddleware

func (l *Logs) MuxMiddleware(ctx *multiplexer.Context)

MuxMiddleware is the middleware function attached to MuxLog. Accepts the context from disgomux.

Jump to

Keyboard shortcuts

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