logs

package
v1.9.5 Latest Latest
Warning

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

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

Documentation

Overview

Package logs handles errors and user feedback.

Index

Examples

Constants

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

)

Variables

View Source
var ErrNoCmd = errors.New("no command argument was provided")

Functions

func Arg

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

Arg returns instructions for invalid command arguments and exits with an error code.

func Danger

func Danger(err error)

Danger logs the error to stdout, but continues the program.

Example
color.Enable = false
logs.Panic(false)
logs.Danger(ErrATest)
Output:

func Fatal

func Fatal(err error)

Fatal logs error to stdout and exits with an error code.

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 the error to stdout, but continue the program.

func Panic

func Panic(b bool)

Panic enables or disables panicking when Danger is used.

func Path

func Path(name string) string

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

func Print

func Print(a ...any)

Print formats using the default formats for its operands and writes to standard output.

func Printcr

func Printcr(a ...any)

Printcr otherwise erases the current line and writes to standard output.

func Printcrf

func Printcrf(format string, a ...any)

Printcrf erases the current line and formats according to a format specifier.

func Printf

func Printf(format string, a ...any)

Printf formats according to a format specifier and writes to standard output.

func Println

func Println(a ...any)

Println formats using the default formats for its operands and writes to standard output.

func Save added in v1.6.0

func Save(filename string, err error) (ok bool)

Save an error to the logs. path is available for unit tests.

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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