zipologger

package module
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 6

README

Golang logging library with:

  1. zip old files
  2. rotation logs per file count
  3. rotation logs per old files
  4. rotation logs per file size

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyLogger = func() *Logger {
	nowhere := &log.Logger{}
	nowhere.SetOutput(io.Discard)
	return &Logger{
		log:      nowhere,
		filename: "",
	}
}()

EmptyLogger is a logger that writes nowhere

View Source
var ErrorCatcher *errorcatcher.System

Functions

func GetMaxCallerDepth

func GetMaxCallerDepth() int

func GetStartCallerDepth

func GetStartCallerDepth() int

func HandlePanic

func HandlePanic()

func HandlePanicLog

func HandlePanicLog(errLog *Logger, e interface{}) string

func SetAlsoToStdout

func SetAlsoToStdout(b bool)

func SetGlobalEncryption added in v0.3.0

func SetGlobalEncryption(key string) bool

func SetMaxCallerDepth

func SetMaxCallerDepth(a int)

func SetStartCallerDepth

func SetStartCallerDepth(a int)

func Stack

func Stack() string

func Wait

func Wait()

Types

type GostLogger

type GostLogger struct {
	L *Logger
}

LogLogger uses the standard log package as the logger

func (*GostLogger) Log

func (l *GostLogger) Log(v ...interface{})

Log uses the standard log library log.Output

func (*GostLogger) Logf

func (l *GostLogger) Logf(format string, v ...interface{})

Logf uses the standard log library log.Output

type Logger

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

func GetLoggerBySuffix

func GetLoggerBySuffix(suffix string, name string, logMaxSizeInMB int, maxBackups int, maxAgeInDays int, writeSource bool) *Logger

func NewLogger

func NewLogger(filename string, logMaxSizeInMB int, maxBackups int, maxAgeInDays int, writeFileline bool) *Logger

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, w1 interface{}, w2 ...interface{})

func (*Logger) Flush

func (l *Logger) Flush()

func (*Logger) LimitedPrintf

func (l *Logger) LimitedPrintf(printid string, duration time.Duration, format string, w1 interface{}, w2 ...interface{})

func (*Logger) Print

func (l *Logger) Print(format string) string

func (*Logger) Printf

func (l *Logger) Printf(format string, w1 interface{}, w2 ...interface{}) string

func (*Logger) Println

func (l *Logger) Println(w ...interface{}) string

func (*Logger) SetAlsoToStdout added in v0.0.8

func (l *Logger) SetAlsoToStdout(b bool) *Logger

func (*Logger) SetEncryptionKey added in v0.3.0

func (l *Logger) SetEncryptionKey(key string) *Logger

func (*Logger) Wait added in v0.0.12

func (l *Logger) Wait()

func (*Logger) WriteDateTime added in v0.0.32

func (l *Logger) WriteDateTime(b bool) *Logger

func (*Logger) WriteSourcePath added in v0.0.32

func (l *Logger) WriteSourcePath(b bool) *Logger

func (*Logger) Writer added in v0.0.10

func (l *Logger) Writer() io.Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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