logging

package
v0.0.0-...-3cf2f40 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 10 Imported by: 0

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"
	OutputEnvironment      Environment = "output"
)

defines possibly environments

Jump to

Keyboard shortcuts

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