forked from golang/hotime
完善error库
This commit is contained in:
parent
339302956a
commit
764d88894e
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"../../hotime"
|
"../../hotime"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"golang.org/x/net/websocket"
|
"golang.org/x/net/websocket"
|
||||||
"time"
|
"time"
|
||||||
@ -45,6 +46,7 @@ func main() {
|
|||||||
// return DB, nil
|
// return DB, nil
|
||||||
//})
|
//})
|
||||||
//init
|
//init
|
||||||
|
|
||||||
appIns.Run(hotime.Router{
|
appIns.Run(hotime.Router{
|
||||||
"app": hotime.Proj{
|
"app": hotime.Proj{
|
||||||
"index": hotime.Ctr{
|
"index": hotime.Ctr{
|
||||||
@ -54,6 +56,7 @@ func main() {
|
|||||||
fmt.Println(this.Session("test").ToCeilInt())
|
fmt.Println(this.Session("test").ToCeilInt())
|
||||||
this.Session("test1", 98984984)
|
this.Session("test1", 98984984)
|
||||||
fmt.Println(this.Session("test1").Data)
|
fmt.Println(this.Session("test1").Data)
|
||||||
|
this.Error.SetError(errors.New("dasdasdas"))
|
||||||
//fmt.Println(this.Db.GetTag())
|
//fmt.Println(this.Db.GetTag())
|
||||||
//this.Application.Log.Error("dasdasdas")
|
//this.Application.Log.Error("dasdasdas")
|
||||||
//this.Log.Error("dadasdasd")
|
//this.Log.Error("dadasdasd")
|
||||||
|
@ -82,6 +82,10 @@ func findCaller(skip int) string {
|
|||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
file, line = getCaller(skip + i)
|
file, line = getCaller(skip + i)
|
||||||
if !strings.HasPrefix(file, "logrus") {
|
if !strings.HasPrefix(file, "logrus") {
|
||||||
|
|
||||||
|
if file == "common/error.go" {
|
||||||
|
file, line = getCaller(skip + i + 1)
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user