34 lines
839 B
Go
34 lines
839 B
Go
package xlog
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
)
|
|
|
|
// XLog 日志接口
|
|
type XLog interface{}
|
|
|
|
// These functions write to the standard logger.
|
|
|
|
// Print calls Output to print to the standard logger.
|
|
// Arguments are handled in the manner of fmt.Print.
|
|
func Print(v ...interface{}) {
|
|
log.Output(2, fmt.Sprint(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.Output(2, fmt.Sprintf(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.Output(2, fmt.Sprintln(v...))
|
|
}
|
|
|
|
// Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
|
|
func Fatalf(format string, v ...interface{}) {
|
|
log.Fatalf(format, v...)
|
|
}
|