Log the panic messages
This commit is contained in:
parent
bbbd35e928
commit
275c7f745f
2 changed files with 6 additions and 2 deletions
|
@ -1,9 +1,12 @@
|
|||
package main
|
||||
|
||||
import log "github.com/cihub/seelog"
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"labix.org/v2/mgo"
|
||||
"labix.org/v2/mgo/bson"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -47,7 +50,8 @@ func initDB() *DB {
|
|||
d := new(DB)
|
||||
d.session, err = mgo.Dial(DB_IP)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Critical(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ func main() {
|
|||
InitUpload(db)
|
||||
|
||||
initRouter(db)
|
||||
panic(http.ListenAndServe(":"+PORT, nil))
|
||||
log.Error(http.ListenAndServe(":"+PORT, nil))
|
||||
}
|
||||
|
||||
func initRouter(db *DB) {
|
||||
|
|
Reference in a new issue