logs

package
v1.1.31 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logs handles errors and user feedback.

Index

Constants

View Source
const (
	// GapUser is the configuration and logs subdirectory name.
	GapUser string = "df2"
	// Filename is the default error log filename.
	Filename string = "errors.log"
)

Variables

View Source
var (
	// Panic uses the panic function to handle all error logs.
	Panic = false // nolint:gochecknoglobals
	// Quiet stops most writing to the standard output.
	Quiet = false // nolint:gochecknoglobals
)
View Source
var ErrNoArg = errors.New("no arguments are provided")

ErrNoArg no args.

Functions

func Arg

func Arg(arg string, args ...string) error

Arg returns instructions for invalid command arguments.

func Danger

func Danger(err error)

Danger prints errors but continues the program.

func Fatal

func Fatal(err error)

Fatal logs any errors and exits to the operating system with error code 1.

func Filepath

func Filepath(filename string) string

Filepath is the absolute path and filename of the error log file.

func Log

func Log(err error)

Log an error but do not exit to the operating system.

func Path

func Path(name string) string

Path returns a file or directory path with all missing elements marked in red.

func Print

func Print(a ...interface{})

Print obeys the --quiet flag or formats using the default formats for its operands and writes to standard output.

func Printcr

func Printcr(a ...interface{})

Printcr obeys the --quiet flag or otherwise erases the current line and writes to standard output.

func Printcrf

func Printcrf(format string, a ...interface{})

Printcrf obeys the --quiet flag or otherwise erases the current line and formats according to a format specifier.

func Printf

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

Printf obeys the --quiet flag or formats according to a format specifier and writes to standard output.

func Println

func Println(a ...interface{})

Println obeys the --quiet flag or formats using the default formats for its operands and writes to standard output.

func Simulate

func Simulate()

Simulate prints the --simulate=false flag info.

Types

This section is empty.

Jump to

Keyboard shortcuts

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