Documentation ¶
Index ¶
- Constants
- func Close(closer io.Closer) error
- func DumpStackTrace(logsPath string, sessionID SessionID, appName AppName) crash.RecoveryAction
- func Init(logsPath string, sessionID SessionID, appName AppName, ...) (io.Closer, error)
- func MatchBridgeLogName(filename string) bool
- func MatchGUILogName(filename string) bool
- func MatchLauncherLogName(filename string) bool
- func MatchStackTraceName(name string) bool
- func Sensitive(s string) string
- func WithLogrusField(ctx context.Context, key string, value interface{}) context.Context
- func ZipLogsForBugReport(logsPath string, maxSessionCount int, maxZipSize int64) (*bytes.Buffer, error)
- type AppName
- type FileProvider
- type IMAPLogger
- type Pruner
- type Rotator
- type SMTPDebugLogger
- type SMTPErrorLogger
- type SessionID
Constants ¶
const ( DefaultPruningSize = 1024 * 1024 * 200 NoPruning = -1 )
const ( // DefaultMaxLogFileSize defines the maximum log size we should permit: 5 MB // // The Zendesk limit for an attachment 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. DefaultMaxLogFileSize = 5 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func DumpStackTrace ¶
func DumpStackTrace(logsPath string, sessionID SessionID, appName AppName) crash.RecoveryAction
func Init ¶
func Init(logsPath string, sessionID SessionID, appName AppName, rotationSize, pruningSize int64, level string) (io.Closer, error)
Init Initialize logging. Log files are rotated when their size exceeds rotationSize. if pruningSize >= 0, pruning occurs using the default pruning algorithm.
func MatchBridgeLogName ¶ added in v3.4.0
MatchBridgeLogName return true iff filename is a bridge log filename.
func MatchGUILogName ¶
MatchGUILogName return true iff filename is a bridge-gui log filename.
func MatchLauncherLogName ¶ added in v3.4.0
MatchLauncherLogName return true iff filename is a launcher log filename.
func MatchStackTraceName ¶
func WithLogrusField ¶
Types ¶
type FileProvider ¶
type FileProvider func(index int) (io.WriteCloser, error)
type IMAPLogger ¶
type IMAPLogger struct{}
IMAPLogger implements the writer interface for Gluon IMAP logs.
func NewIMAPLogger ¶
func NewIMAPLogger() *IMAPLogger
type Rotator ¶
type Rotator struct {
// contains filtered or unexported fields
}
func NewDefaultRotator ¶ added in v3.4.0
func NewRotator ¶
func NewRotator(maxFileSize int64, getFile FileProvider, prune Pruner) (*Rotator, 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
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{})
type SessionID ¶ added in v3.4.0
type SessionID string
func NewSessionID ¶ added in v3.4.0
func NewSessionID() SessionID
NewSessionID creates a sessionID based on the current time.
func NewSessionIDFromString ¶ added in v3.4.0
NewSessionIDFromString Return a new sessionID from string. If the str is empty a new time based sessionID is returned, otherwise the string is used as the sessionID.