Ejemplo n.º 1
0
// Info is a function for informing the user what is going on.  It will
// always log to file and optionally with -debug print to stdout and
// also will have nice coloredoutput as long as -nocolor is not supplied.
func Info(i ...interface{}) {
	s := TypeString(i)
	if DebugLog {
		if Color {
			term.Cyan(os.Stdout, "Info: "+s+"\n")

		} else {
			fmt.Print("Info: " + s)
		}
	}
	Log.SetPrefix("INFO ")
	Log.Println(s)
	log.SetPrefix("")
}
Ejemplo n.º 2
0
func main() {
	// On windows, it is possible, though unlikely,
	// to fail to write to the console. An error
	// is returned.
	f := os.Stdout

	if err := term.Black(f, "Black"); err != nil {
		fmt.Printf("Stupid windows system calls: %v\n", err)
	}

	fmt.Println()
	term.White(f, "White")
	fmt.Println()
	term.Red(f, "Red")
	fmt.Println()
	term.LightRed(f, "Light Red")
	fmt.Println()
	term.Green(f, "Green")
	fmt.Println()
	term.LightGreen(f, "Light Green")
	fmt.Println()
	term.DarkYellow(f, "Dark Yellow")
	fmt.Println()
	term.LightYellow(f, "Light Yellow")
	fmt.Println()
	term.Blue(f, "Blue")
	fmt.Println()
	term.LightBlue(f, "Light Blue")
	fmt.Println()
	term.Magenta(f, "Magenta")
	fmt.Println()
	term.LightMagenta(f, "Light Magenta")
	fmt.Println()
	term.Cyan(f, "Cyan")
	fmt.Println()
	term.LightCyan(f, "Light Cyan")
	fmt.Println()
}