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:
@ -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!
|
||||
|
||||
|
Reference in New Issue
Block a user