Use new log wrapper and add more functions to it.

This commit is contained in:
Eugene Bujak
2018-12-29 17:23:42 +03:00
parent 7463e54258
commit d8802a9709
22 changed files with 96 additions and 123 deletions

View File

@@ -12,12 +12,34 @@ import (
var Verbose = false
// Print calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Print.
func Print(v ...interface{}) {
log.Print(v...)
}
// Printf calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Printf.
func Printf(format string, v ...interface{}) {
log.Printf(format, v...)
}
// Println calls Output to print to the standard logger.
// Arguments are handled in the manner of fmt.Println.
func Println(v ...interface{}) {
log.Println(v...)
}
// Fatal is equivalent to Print() followed by a call to os.Exit(1).
func Fatal(v ...interface{}) {
log.Fatal(v...)
}
// Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
func Fatalf(format string, v ...interface{}) {
log.Fatalf(format, v...)
}
func Tracef(format string, v ...interface{}) {
if Verbose {
pc := make([]uintptr, 10) // at least 1 entry needed