logging

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareFile

func PrepareFile(filename string, owner *user.User) error

PrepareFile creates logfile and set it writable for user

func SetFile

func SetFile(filename string) error

SetFile for default logger

func SetLevel added in v0.5.1

func SetLevel(lvl string) error

SetLevel for default logger

func Test added in v0.5.0

func Test(callable func(TestOut))

Test run callable with changed logging output

func TestWithLevel added in v0.5.1

func TestWithLevel(level string, callable func(TestOut))

TestWithLevel run callable with changed logging output and log level

Types

type FileLogger

type FileLogger struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

FileLogger wrapper

func NewFileLogger

func NewFileLogger() *FileLogger

NewFileLogger create instance FileLogger

func (*FileLogger) Filename

func (l *FileLogger) Filename() string

Filename returns current filename

func (*FileLogger) Open

func (l *FileLogger) Open(filename string) error

Open file for logging

func (*FileLogger) Reopen

func (l *FileLogger) Reopen() error

Reopen file

type TestOut added in v0.8.0

type TestOut interface {
	Write(p []byte) (n int, err error)
	String() string
}

type TextFormatter

type TextFormatter struct {
}

TextFormatter копипаста logrus.TextFormatter с косметическими изменениями

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format returns formatted message text

Jump to

Keyboard shortcuts

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