debuglog

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package debuglog configures Logrus. It configures Logrus to print out file and line info, to use UTC timestamps with subsecond precision, etc.

This should be used from every main package. When you import this package, it will run Configure with default options. Users should document that in their import lines or call Configure again explicitly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(opts Options)

Configure sets up the debug logger. It's safe to call more than once. It should not be called concurrently (results are undefined if called concurrently with different Options).

Types

type Options

type Options struct {
	// If true, the logger will highlight some output with ANSI colors. This
	// might not work in all situations, such as when writing into a file.
	//
	// This may be overridden by setting the environment variable
	// "CLICOLOR_FORCE" to "1".
	ForceColors bool

	// If not nil, this will set up the given logger. If nil, it will set up the
	// default Logrus logger (see logrus.StandardLogger()).
	//
	// This is primarily used for unit testing.
	Logger *logrus.Logger
}

Options are used to control the debug logger's behavior. The default Options are represented by the zero value.

Jump to

Keyboard shortcuts

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