Documentation ¶
Overview ¶
Package log provides common log functions to the cli infrastructure.
Index ¶
- Variables
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func DoneMsgln(msg string)
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Out(v ...interface{})
- func Outf(format string, v ...interface{})
- func Outln(v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Level
Constants ¶
This section is empty.
Variables ¶
var ( // DebugLogger will reveal debug info which can be internal; will not be part of public binary DebugLogger = log.New(os.Stdout, colorMaybe("[DEBUG] ", color.HiBlueString), log.Ldate|log.Ltime|log.Llongfile) // InfoLogger sends useful but verbose information. Only sends if severity is >= InfoLevel. InfoLogger = log.New(os.Stdout, "[INFO] ", log.Ldate|log.Ltime) // OutLogger sends an important output from execution of the command, intended for a user to read. OutLogger = log.New(os.Stdout, "", 0) // WarnLogger sends warnings to stderr. WarnLogger = log.New(os.Stderr, colorMaybe("[WARNING] ", color.YellowString), 0) // ErrorLogger sends errors to stderr. ErrorLogger = log.New(os.Stderr, colorMaybe("[ERROR] ", color.RedString), 0) // Severity can be set to restrict level of log messages. Severity = WarnLevel )
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls Output to print to the DebugLogger. Arguments are handled in the manner of fmt.Printf.
func Debugln ¶
func Debugln(v ...interface{})
Debugln calls Output to print to the DebugLogger. Arguments are handled in the manner of fmt.Println.
func DoneMsgln ¶
func DoneMsgln(msg string)
DoneMsgln surrounds msg with helpful visual cues for the user to indicate completion of a task.
func Error ¶
func Error(v ...interface{})
Error calls Output to print to the ErrorLogger. Arguments are handled in the manner of fmt.Print.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls Output to print to the ErrorLogger. Arguments are handled in the manner of fmt.Printf.
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls Output to print to the InfoLogger. Arguments are handled in the manner of fmt.Printf.
func Infoln ¶
func Infoln(v ...interface{})
Infoln calls Output to print to the InfoLogger. Arguments are handled in the manner of fmt.Println.
func Out ¶
func Out(v ...interface{})
Out calls Output to print to the OutLogger. Arguments are handled in the manner of fmt.Print.
func Outf ¶
func Outf(format string, v ...interface{})
Outf calls Output to print to the OutLogger. Arguments are handled in the manner of fmt.Printf.
func Outln ¶
func Outln(v ...interface{})
Outln calls Output to print to the OutLogger. Arguments are handled in the manner of fmt.Println.