From 3e4d806a57483205da686c0c6b42fcbd1651764f Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Tue, 24 Mar 2020 16:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QMPlusServer/main.go | 8 +++----- QMPlusServer/static/config/config.json | 8 +++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/QMPlusServer/main.go b/QMPlusServer/main.go index 5bcbf1b2..48969a34 100644 --- a/QMPlusServer/main.go +++ b/QMPlusServer/main.go @@ -1,9 +1,6 @@ package main import ( - "os" - - "fmt" "gin-vue-admin/cmd" "gin-vue-admin/config" "gin-vue-admin/init/initRedis" @@ -11,6 +8,7 @@ import ( "gin-vue-admin/init/initlog/qmlog" "gin-vue-admin/init/qmsql" "gin-vue-admin/init/registTable" + "os" //"runtime" ) @@ -28,8 +26,8 @@ var ( ) func main() { - if err:= qmlog.NewLogger(); err != nil { - fmt.Println(err) + if err := qmlog.NewLogger(); err != nil { + panic(err) } // 可以通过环境变量来覆盖配置值 // 未设定有效的环境变量时,使用配置值 diff --git a/QMPlusServer/static/config/config.json b/QMPlusServer/static/config/config.json index 57cbad6f..69ec2409 100644 --- a/QMPlusServer/static/config/config.json +++ b/QMPlusServer/static/config/config.json @@ -7,7 +7,7 @@ }, "mysqladmin": { "username": "root", - "password": "YINGL19980716.", + "password": "Aa@6447985", "path": "127.0.0.1:3306", "dbname": "qmPlus", "config": "charset=utf8\u0026parseTime=True\u0026loc=Local", @@ -33,5 +33,11 @@ "keyLong": 6, "imgWidth": 120, "imgHeight": 40 + }, + "log": { + "prefix": "[GIN-VUE-ADMIN]", + "logFile": false, + "stdout": ["DEBUG"], + "file": ["WARNING"] } } \ No newline at end of file