Commit a58115fe authored by astaxie's avatar astaxie

orm log delete repetition time

parent f9b5b0f5
...@@ -68,7 +68,7 @@ const ( ...@@ -68,7 +68,7 @@ const (
// Define common vars // Define common vars
var ( var (
Debug = false Debug = false
DebugLog = NewLog(os.Stderr) DebugLog = NewLog(os.Stdout)
DefaultRowsLimit = 1000 DefaultRowsLimit = 1000
DefaultRelsDepth = 2 DefaultRelsDepth = 2
DefaultTimeLoc = time.Local DefaultTimeLoc = time.Local
...@@ -247,7 +247,7 @@ func (o *orm) Update(md interface{}, cols ...string) (int64, error) { ...@@ -247,7 +247,7 @@ func (o *orm) Update(md interface{}, cols ...string) (int64, error) {
// cols shows the delete conditions values read from. deafult is pk // cols shows the delete conditions values read from. deafult is pk
func (o *orm) Delete(md interface{}, cols ...string) (int64, error) { func (o *orm) Delete(md interface{}, cols ...string) (int64, error) {
mi, ind := o.getMiInd(md, true) mi, ind := o.getMiInd(md, true)
num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ,cols) num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ, cols)
if err != nil { if err != nil {
return num, err return num, err
} }
......
...@@ -42,7 +42,7 @@ func debugLogQueies(alias *alias, operaton, query string, t time.Time, err error ...@@ -42,7 +42,7 @@ func debugLogQueies(alias *alias, operaton, query string, t time.Time, err error
if err != nil { if err != nil {
flag = "FAIL" flag = "FAIL"
} }
con := fmt.Sprintf(" - %s - [Queries/%s] - [%s / %11s / %7.1fms] - [%s]", t.Format(formatDateTime), alias.Name, flag, operaton, elsp, query) con := fmt.Sprintf(" -[Queries/%s] - [%s / %11s / %7.1fms] - [%s]", alias.Name, flag, operaton, elsp, query)
cons := make([]string, 0, len(args)) cons := make([]string, 0, len(args))
for _, arg := range args { for _, arg := range args {
cons = append(cons, fmt.Sprintf("%v", arg)) cons = append(cons, fmt.Sprintf("%v", arg))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment