Browse Source

更新日志打印功能

main
pixel 5 years ago
parent
commit
3e4d806a57
  1. 6
      QMPlusServer/main.go
  2. 8
      QMPlusServer/static/config/config.json

6
QMPlusServer/main.go

@ -1,9 +1,6 @@
package main package main
import ( import (
"os"
"fmt"
"gin-vue-admin/cmd" "gin-vue-admin/cmd"
"gin-vue-admin/config" "gin-vue-admin/config"
"gin-vue-admin/init/initRedis" "gin-vue-admin/init/initRedis"
@ -11,6 +8,7 @@ import (
"gin-vue-admin/init/initlog/qmlog" "gin-vue-admin/init/initlog/qmlog"
"gin-vue-admin/init/qmsql" "gin-vue-admin/init/qmsql"
"gin-vue-admin/init/registTable" "gin-vue-admin/init/registTable"
"os"
//"runtime" //"runtime"
) )
@ -29,7 +27,7 @@ var (
func main() { func main() {
if err := qmlog.NewLogger(); err != nil { if err := qmlog.NewLogger(); err != nil {
fmt.Println(err)
panic(err)
} }
// 可以通过环境变量来覆盖配置值 // 可以通过环境变量来覆盖配置值
// 未设定有效的环境变量时,使用配置值 // 未设定有效的环境变量时,使用配置值

8
QMPlusServer/static/config/config.json

@ -7,7 +7,7 @@
}, },
"mysqladmin": { "mysqladmin": {
"username": "root", "username": "root",
"password": "YINGL19980716.",
"password": "Aa@6447985",
"path": "127.0.0.1:3306", "path": "127.0.0.1:3306",
"dbname": "qmPlus", "dbname": "qmPlus",
"config": "charset=utf8\u0026parseTime=True\u0026loc=Local", "config": "charset=utf8\u0026parseTime=True\u0026loc=Local",
@ -33,5 +33,11 @@
"keyLong": 6, "keyLong": 6,
"imgWidth": 120, "imgWidth": 120,
"imgHeight": 40 "imgHeight": 40
},
"log": {
"prefix": "[GIN-VUE-ADMIN]",
"logFile": false,
"stdout": ["DEBUG"],
"file": ["WARNING"]
} }
} }
Loading…
Cancel
Save