Documentation ¶
Overview ¶
Package log provides utilities for providing output to the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.