1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 17:00:19 +00:00

orm add queries debug logger

This commit is contained in:
slene
2013-08-09 13:20:19 +08:00
parent 8563000235
commit 45aa071261
8 changed files with 216 additions and 26 deletions

View File

@ -97,9 +97,11 @@ func NewComment() *Comment {
var DBARGS = struct {
Driver string
Source string
Debug string
}{
os.Getenv("ORM_DRIVER"),
os.Getenv("ORM_SOURCE"),
os.Getenv("ORM_DEBUG"),
}
var dORM Ormer
@ -111,6 +113,8 @@ func init() {
RegisterModel(new(Tag))
RegisterModel(new(Comment))
Debug, _ = StrTo(DBARGS.Debug).Bool()
if DBARGS.Driver == "" || DBARGS.Source == "" {
fmt.Println(`need driver and source!