优化数据与日志模块

This commit is contained in:
boyce
2019-02-13 16:17:06 +08:00
parent e484d0a18b
commit 1ef059e236
2 changed files with 9 additions and 1 deletions

View File

@@ -9,10 +9,13 @@ import (
"strconv"
"strings"
"time"
"github.com/duanhf2012/origin/service"
)
// DBModule ...
type DBModule struct {
service.BaseModule
db *sql.DB
URL string
UserName string
@@ -31,6 +34,11 @@ type DBResult struct {
blur bool
}
//OnInit ...
func (slf *DBModule) Init() {
slf.Connect(100)
}
// Next ...
func (slf *DBResult) Next() bool {
if slf.Err != nil {

View File

@@ -50,7 +50,7 @@ func (slf *LogModule) CheckAndGenFile() {
var err error
slf.logFile, err = os.Create(slf.GetCurrentFileName())
if err != nil {
fmt.Print("create log file %s error!", slf.GetCurrentFileName())
fmt.Printf("create log file %+v error!", slf.GetCurrentFileName())
return
}