zipologger

package module
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 16 Imported by: 2

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(ioutil.Discard)
	return &Logger{
		log:      nowhere,
		filename: "",
	}
}()

you can set Logger to this to write 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(err_log *Logger, e interface{}) string

intercept panics and save it to file

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

Current stack dump

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, log_max_size_in_mb int, max_backups int, max_age_in_days int, write_source bool) *Logger

func NewLogger

func NewLogger(filename string, log_max_size_in_mb int, max_backups int, max_age_in_days int, write_fileline 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{})

prints format not often then diration time per printid

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()

waiting till all will be written

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