log

package
v0.7.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package log provides utilities for providing output to the user.

Index

Constants

This section is empty.

Variables

View Source
var Logger = logging.MustGetLogger("fossa-cli")

Logger is a re-exported logger from `go-logging`. Originally, we provided wrapper functions around the specific logging methods that we use, but this causes the package, file, and line numbers to be useless (they all point to the wrapper instead of the caller). Instead, we only use the documented log levels below:

_Debug_ messages are used for tracing execution and diagnosing unintended error cases.

_Notice_ messages are non-error events that the user should be informed of, such as notifications that an action has occurred.

_Warning_ messages are non-fatal error events that the user should be informed of. Generally, the user can do something to fix these.

_Fatal_ messages are non-recoverable errors, and cause an `os.Exit(1)`. They should be used for foreseen error conditions that we cannot continue from.

_Panic_ messages are errors that are unforeseen, should never happen, and indicate that something has gone terribly wrong. They are akin to assertion failures, and are generally only used as sanity checks for invariants.

Functions

func Initialize added in v0.6.1

func Initialize(interactive, debug bool)

Initialize configures logging. If `interactive` is true, then logging will include colors and ANSI codes (e.g. spinners). If `debug` is true, then logging will include debugging output.

func Print added in v0.6.1

func Print(args ...interface{})

Print outputs a literal message to STDOUT.

func Printf added in v0.6.1

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

Printf outputs a formatted message to STDOUT.

func ShowSpinner added in v0.6.1

func ShowSpinner(message string)

ShowSpinner shows a progress spinner with a message.

func StopSpinner added in v0.6.1

func StopSpinner()

StopSpinner stops a progress spinner.

Types

type Entry added in v0.6.1

type Entry struct {
	Message string
	Error   error
	Fields  Fields
}

func (Entry) String added in v0.6.1

func (e Entry) String() string

type Fields added in v0.6.1

type Fields map[string]interface{}

Jump to

Keyboard shortcuts

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