Documentation ¶
Overview ¶
Package logs handles errors and user feedback.
Index ¶
- Constants
- Variables
- func Arg(arg string, exit bool, args ...string) error
- func Danger(err error)
- func Fatal(err error)
- func Filepath(filename string) string
- func IsQuiet() bool
- func Log(err error)
- func Panic(b bool)
- func Path(name string) string
- func Print(a ...interface{})
- func Printcr(a ...interface{})
- func Printcrf(format string, a ...interface{})
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func Quiet(b bool)
- func Simulate()
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 ErrNoArg = errors.New("no arguments were provided")
Functions ¶
func Danger ¶
func Danger(err error)
Danger logs the error to stdout, but continues the program.
Example ¶
package main import ( "github.com/Defacto2/df2/lib/logs" "github.com/gookit/color" ) func main() { color.Enable = false logs.Panic(false) logs.Danger(logs.ErrATest) }
Output:
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.