log

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Overview

Package log implements utility methods for logging in a colorful manner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FancyLogFormatter added in v0.2.0

type FancyLogFormatter struct {
	UseColors bool
}

FancyLogFormatter is the default logger for brig.

func (*FancyLogFormatter) Format added in v0.2.0

func (flf *FancyLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format logs a single entry according to our formatting ideas.

type SyslogWrapper added in v0.2.0

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

SyslogWrapper is a hacky way to make the syslog more readable. This only works with FancyLogFormatter from above. It takes it's output, checks what log level was used and puts it into syslog with the right notice level.

func NewSyslogWrapper added in v0.2.0

func NewSyslogWrapper(w *syslog.Writer) SyslogWrapper

NewSyslogWrapper creates a SyslogWrapper and calls the right log level for each line.

func (SyslogWrapper) Write added in v0.2.0

func (sw SyslogWrapper) Write(data []byte) (int, error)

type Writer

type Writer struct {
	// Level determines the severity for all messages.
	Level logrus.Level
}

Writer is an io.Writer that writes everything to logrus.

func (*Writer) Write

func (l *Writer) Write(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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