logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logger provides a custom TextFormatter for use with the github.com/sirupsen/logrus library. Please refer to https://github.com/sirupsen/logrus#formatters for general usage guidelines on logrus formatters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextFormatter

type TextFormatter struct {
	// Disable timestamp logging. useful when output is redirected to logging
	// system that already adds timestamps
	DisableTimestamp bool

	// Disable the conversion of the log levels to uppercase
	DisableUppercase bool

	// Timestamp format to use for display when a full timestamp is printed
	TimestampFormat string

	// The fields are sorted by default for a consistent output
	DisableSorting bool

	// Wrap empty fields in quotes if true
	QuoteEmptyFields bool

	// Can be set to the override the default quoting character "
	// with something else. For example: ', or `.
	QuoteCharacter string

	// The name of the module (webserver, redis, cluster-kafka, etc...),
	// prints before the log message, doesn't print if empty
	ModuleName string

	sync.Once
}

TextFormatter maintains a list of options to apply while formatting your log output. For more information about the Timestamp format refer to https://golang.org/pkg/time/.

func (*TextFormatter) Format

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

Format renders a single log entry. It is meant to be called from github.com/sirupsen/logrus.

Jump to

Keyboard shortcuts

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