logging

package
v0.0.0-...-ab145b9 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscordgoLogger

func DiscordgoLogger(logger *zap.Logger) func(msgL, caller int, format string, a ...interface{})

DiscordgoLogger returns a logger to use with github.com/bwmarrin/discordgo

func NewLogger

func NewLogger(env Environment, service, discordWebhookURL string, client *http.Client) (*zap.Logger, error)

NewLogger creates a zap.DiscordgoLogger based on the environment

func NewZapHookDiscord

func NewZapHookDiscord(serviceName, webhookURL string, client *http.Client) func(zapcore.Entry) error

NewZapHookDiscord sends Zap log messages to a Discord Webhook TODO: ratelimit

Types

type Environment

type Environment string

Environment represents a environment in which a service is running

const (
	DevelopmentEnvironment Environment = "development"
	ProductionEnvironment  Environment = "production"
)

defines possibly environments

Jump to

Keyboard shortcuts

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