logging

package
v3.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLogSize defines the maximum log size we should permit: 5 MB
	//
	// The Zendesk limit for an attachement is 50MB and this is what will
	// be allowed via the API. However, if that fails for some reason, the
	// fallback is sending the report via email, which has a limit of 10mb
	// total or 7MB per file. Since we can produce up to 6 logs, and we
	// compress all the files (avarage compression - 80%), we need to have
	// a limit of 30MB total before compression, hence 5MB per log file.
	MaxLogSize = 5 * 1024 * 1024

	// MaxLogs defines how many log files should be kept.
	MaxLogs = 3
)

Variables

This section is empty.

Functions

func DumpStackTrace

func DumpStackTrace(logsPath string) crash.RecoveryAction

func Init

func Init(logsPath, level string) error

func LogFromContext

func LogFromContext(ctx context.Context) *logrus.Entry

func MatchGUILogName

func MatchGUILogName(name string) bool

func MatchLogName

func MatchLogName(name string) bool

func MatchStackTraceName

func MatchStackTraceName(name string) bool

func Sensitive

func Sensitive(s string) string

func WithLogrusField

func WithLogrusField(ctx context.Context, key string, value interface{}) context.Context

Types

type FileProvider

type FileProvider func() (io.WriteCloser, error)

type IMAPLogger

type IMAPLogger struct{}

IMAPLogger implements the writer interface for Gluon IMAP logs.

func NewIMAPLogger

func NewIMAPLogger() *IMAPLogger

func (*IMAPLogger) Write

func (l *IMAPLogger) Write(p []byte) (n int, err error)

type Rotator

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

func NewRotator

func NewRotator(maxSize int, getFile FileProvider) (*Rotator, error)

func (*Rotator) Write

func (r *Rotator) Write(p []byte) (int, error)

type SMTPDebugLogger

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

SMTPDebugLogger implements the writer interface for debug SMTP logs.

func NewSMTPDebugLogger

func NewSMTPDebugLogger() *SMTPDebugLogger

func (*SMTPDebugLogger) Write

func (l *SMTPDebugLogger) Write(p []byte) (n int, err error)

type SMTPErrorLogger

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

SMTPErrorLogger implements go-smtp/logger interface.

func NewSMTPLogger

func NewSMTPLogger() *SMTPErrorLogger

func (*SMTPErrorLogger) Printf

func (s *SMTPErrorLogger) Printf(format string, args ...interface{})

func (*SMTPErrorLogger) Println

func (s *SMTPErrorLogger) Println(args ...interface{})

Jump to

Keyboard shortcuts

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