logging

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLogSize defines the maximum log size we should permit.
	// Zendesk has a file size limit of 20MB. When the last N log files are zipped,
	// it should fit under 20MB. So here we permit up to 10MB (most files are a few hundred kB).
	MaxLogSize = 10 * 2 << 20

	// MaxLogs defines how many old 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 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