logging

package
v2.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 12 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 string) error

func MatchGUILogName added in v2.4.8

func MatchGUILogName(name string) bool

func MatchLogName

func MatchLogName(name string) bool

func MatchStackTraceName

func MatchStackTraceName(name string) bool

func SetLevel

func SetLevel(level string)

SetLevel will change the level of logging and in case of Debug or Trace level it will also prevent from writing to file. Setting level to Info or higher will not set writing to file again if it was previously cancelled by Debug or Trace.

Types

type FileProvider

type FileProvider func() (io.WriteCloser, 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)

Jump to

Keyboard shortcuts

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