作者 yangfu

console log

package log
import (
"log"
)
type ConsoleLog struct {
}
func newConsoleLog()Log{
return &ConsoleLog{}
}
func(this *ConsoleLog)Debug(args ...interface{}){
//this.log.Debug(args...)
log.Println(args...)
}
func(this *ConsoleLog)Info(args ...interface{}){
log.Println(args...)
}
func(this *ConsoleLog)Warn(args ...interface{}){
log.Println(args...)
}
func(this *ConsoleLog)Error(args ...interface{}){
log.Println(args...)
}
func(this *ConsoleLog)Panic(args ...interface{}){
log.Println(args...)
}
func(this *ConsoleLog)Fatal(args ...interface{}){
log.Println(args...)
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ type Log interface{
}
var(
DefaultLog Log
DefaultLog Log =newConsoleLog()
)
func InitLog(conf config.Logger){
... ... @@ -36,3 +36,4 @@ func Panic(args ...interface{}){
func Fatal(args ...interface{}){
DefaultLog.Fatal(args...)
}
... ...
... ... @@ -3,7 +3,6 @@ package mybeego
import (
"fmt"
"github.com/astaxie/beego"
"time"
)
//type IMessage interface {
... ... @@ -32,7 +31,7 @@ func NewMessage(code int) *Message {
return &Message{
Errno: code,
Errmsg: ErrnoMsg[code],
SysTime: time.Now().Unix(),
//SysTime: time.Now().Unix(),
}
}
... ...