Use new log wrapper and add more functions to it.
This commit is contained in:
22
log/log.go
22
log/log.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user