redlog: github.com/tidwall/redlog Index | Files

package redlog

import "github.com/tidwall/redlog"

Package redlog provides a Redis compatible logger.

http://build47.com/redis-log-format-levels/

Index

Package Files

redlog.go

Variables

var HashicorpRaftFilter func(line string, tty bool) (msg string, app byte, level logLevel)

HashicorpRaftFilter is used as a filter to convert a log message from the hashicorp/raft package into redlog structured message.

func RedisLogColorizer Uses

func RedisLogColorizer(wr io.Writer) io.Writer

RedisLogColorizer filters the Redis log output and colorizes it.

type Logger Uses

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

Logger represents a logger

func New Uses

func New(wr io.Writer) *Logger

New creates a new Logger

func (*Logger) Debug Uses

func (l *Logger) Debug(args ...interface{})

Debug writes a debug message.

func (*Logger) Debugf Uses

func (l *Logger) Debugf(format string, args ...interface{})

Debugf writes a debug message.

func (*Logger) Debugln Uses

func (l *Logger) Debugln(args ...interface{})

Debugln writes a debug message.

func (*Logger) Fatal Uses

func (l *Logger) Fatal(args ...interface{})

Fatal writes a warning message and exit process with exit code 1.

func (*Logger) Fatalf Uses

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

Fatalf writes a warning message and exit process with exit code 1.

func (*Logger) Fatalln Uses

func (l *Logger) Fatalln(args ...interface{})

Fatalln writes a warning message and exit process with exit code 1.

func (*Logger) GoLogger Uses

func (l *Logger) GoLogger() *log.Logger

GoLogger returns a standard Go log.Logger which when used, will print in the Redlog format.

func (*Logger) Notice Uses

func (l *Logger) Notice(args ...interface{})

Notice writes a notice message.

func (*Logger) Noticef Uses

func (l *Logger) Noticef(format string, args ...interface{})

Noticef writes a notice message.

func (*Logger) Noticeln Uses

func (l *Logger) Noticeln(args ...interface{})

Noticeln writes a notice message.

func (*Logger) Print Uses

func (l *Logger) Print(args ...interface{})

Print writes a default message.

func (*Logger) Printf Uses

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

Printf writes a default message.

func (*Logger) Println Uses

func (l *Logger) Println(args ...interface{})

Println writes a default message.

func (*Logger) SetFilter Uses

func (l *Logger) SetFilter(filter func(line string, tty bool) (msg string, app byte, level logLevel))

SetFilter set the logger filter. A filter can be used to process standard writes into structured redlog format.

func (*Logger) SetIgnoreDups Uses

func (l *Logger) SetIgnoreDups(t bool)

func (*Logger) SetLevel Uses

func (l *Logger) SetLevel(level int)

SetLevel sets the level of the logger.

0 - Debug
1 - Verbose
2 - Notice
3 - Warning

func (*Logger) Sub Uses

func (l *Logger) Sub(app byte) *Logger

Sub creates a logger that inherits the properties of the caller logger. The app parameter will be used in the output message.

func (*Logger) Verbose Uses

func (l *Logger) Verbose(args ...interface{})

Verbose writes a verbose message.

func (*Logger) Verbosef Uses

func (l *Logger) Verbosef(format string, args ...interface{})

Verbosef writes a verbose message.

func (*Logger) Verboseln Uses

func (l *Logger) Verboseln(args ...interface{})

Verboseln writes a verbose message.

func (*Logger) Warning Uses

func (l *Logger) Warning(args ...interface{})

Warning writes a warning message.

func (*Logger) Warningf Uses

func (l *Logger) Warningf(format string, args ...interface{})

Warningf writes a warning message.

func (*Logger) Warningln Uses

func (l *Logger) Warningln(args ...interface{})

Warningln writes a warning message.

func (*Logger) Write Uses

func (l *Logger) Write(p []byte) (int, error)

Write writes to the log

Package redlog imports 9 packages (graph) and is imported by 10 packages. Updated 2018-05-25. Refresh now. Tools for package owners.