logging

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVerbosityConflict = errors.New(
	"verbose and verbosity can not both be set",
)
View Source
var Logger = logrus.New()

Logger is the custom global logger object.

Functions

func SetLogLevel

func SetLogLevel(loglevel Verbosity)

SetLogLevel sets the log-level for the logger basing on the Verbosity provided. The log level string must be correct, otherwise function will panic.

func VerbosityToDebug

func VerbosityToDebug(verbosity Verbosity) bool

Types

type Verbosity

type Verbosity int
const (
	UnknownLevel   Verbosity = iota // Unknown verbosity, no logs in Ansible.
	TimestampLevel                  // Timestamp logs in Ansible, Ansible verbosity set to 1
	ErrorLevel                      // Ansible verbosity set to 2
	WarningLevel                    // Ansible verbosity set to 3
	InfoLevel                       // Ansible verbosity set to 4
	DebugLevel                      // Ansible verbosity set to 5, Packer debug flag on
	TraceLevel                      // Ansible verbosity set to 6
)

func IntToVerbosity

func IntToVerbosity(verbosity int) Verbosity

func VerbosityFromFlags

func VerbosityFromFlags(verbose bool, verbosity int) (Verbosity, error)

VerbosityFromFlags returns the verbosity given "verbose" and "verbosity" flags.

Jump to

Keyboard shortcuts

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