Help us shape the future of Go! Take the 2026 Go Developer Survey

webhookLog

package module
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

README

webhookLog

A simple package for using discord webhooks as a logging mechanism

Rate limit is 16-17 logs a second, at 2000 characters max per webhook, this is 32000-34000 characters a second max you can log to discord

Usage
var Log *webhookLog.DefaultLogger
Log = webhookLog.NewDefaultLogger("LOGGER_NAME", "WEBHOOK_KEY")
Log.SetLevel(webhookLog.Debug)
Log.Info("Logging setup")
Install

go get github.com/abearinatrap/webhookLog@v0.1.5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct {
	// contains filtered or unexported fields
}

func NewDefaultLogger

func NewDefaultLogger(name string, nkey string) *DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string)

func (*DefaultLogger) Debugf

func (l *DefaultLogger) Debugf(msg string, args ...interface{})

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string)

func (*DefaultLogger) Errorf

func (l *DefaultLogger) Errorf(msg string, args ...interface{})

func (*DefaultLogger) Fatal

func (l *DefaultLogger) Fatal(msg string)

func (*DefaultLogger) Fatalf

func (l *DefaultLogger) Fatalf(msg string, args ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string)

func (*DefaultLogger) Infof

func (l *DefaultLogger) Infof(msg string, args ...interface{})

func (*DefaultLogger) SetKey

func (l *DefaultLogger) SetKey(key string)

func (*DefaultLogger) SetLevel

func (l *DefaultLogger) SetLevel(level LogLevel)

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(msg string)

func (*DefaultLogger) Warnf

func (l *DefaultLogger) Warnf(msg string, args ...interface{})

type LogLevel

type LogLevel int
const (
	Debug LogLevel = iota
	Info
	Warn
	Error
	Fatal
)

type Logger

type Logger interface {
	SetLevel(level LogLevel)
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Fatal(msg string, args ...interface{})
}

type TimeProvider added in v0.2.11

type TimeProvider struct {
	// contains filtered or unexported fields
}

func (*TimeProvider) Set added in v0.2.11

func (tp *TimeProvider) Set(t time.Time)

func (*TimeProvider) Stored added in v0.2.11

func (tp *TimeProvider) Stored() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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