From a58115fed269b1502f65bb14182abecdad4bae56 Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 15 Sep 2016 10:53:40 +0800 Subject: [PATCH] orm log delete repetition time --- orm/orm.go | 4 ++-- orm/orm_log.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/orm/orm.go b/orm/orm.go index 9a81b620..538916e4 100644 --- a/orm/orm.go +++ b/orm/orm.go @@ -68,7 +68,7 @@ const ( // Define common vars var ( Debug = false - DebugLog = NewLog(os.Stderr) + DebugLog = NewLog(os.Stdout) DefaultRowsLimit = 1000 DefaultRelsDepth = 2 DefaultTimeLoc = time.Local @@ -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 func (o *orm) Delete(md interface{}, cols ...string) (int64, error) { 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 { return num, err } diff --git a/orm/orm_log.go b/orm/orm_log.go index 54723273..26c73f9e 100644 --- a/orm/orm_log.go +++ b/orm/orm_log.go @@ -42,7 +42,7 @@ func debugLogQueies(alias *alias, operaton, query string, t time.Time, err error if err != nil { 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)) for _, arg := range args { cons = append(cons, fmt.Sprintf("%v", arg))