diff --git a/res/en/messages.json b/res/en/messages.json index 31aa7675d836ee2cbe47c8f14ba3be27880770cc..3189a236a4be749dde752bafe736a3783efe308d 100644 --- a/res/en/messages.json +++ b/res/en/messages.json @@ -103,11 +103,11 @@ }, { "id": "server_request", - "translation": "\nGot %s request %s." + "translation": "\nGot %s request %s. " }, { "id": "server_response", - "translation": "\nCreate %d records in %d sec." + "translation": "Create %d records in %d sec." }, { "id": "excel_data", diff --git a/res/zh/messages.json b/res/zh/messages.json index 4ed88d7ebe24357d507365af2bd12e32b3c8d378..2a28b2d9300ad3dfd36bf77465343f22f581ea87 100644 --- a/res/zh/messages.json +++ b/res/zh/messages.json @@ -94,11 +94,11 @@ }, { "id": "server_request", - "translation": "\n收到%s请求 %s." + "translation": "\n收到%s请求 %s。" }, { "id": "server_response", - "translation": "生成%d条记录,耗时%d秒" + "translation": "生成%d条记录,耗时%d秒。" }, { "id": "excel_data", diff --git a/res/zh/sample.yaml b/res/zh/sample.yaml index 3d26c9f54e972c2eb93e83863c7c75e0441adbd6..fdcc899634b7b124bb8618410917aba8769b05b1 100644 --- a/res/zh/sample.yaml +++ b/res/zh/sample.yaml @@ -120,7 +120,7 @@ fields: - field: field_use_excel # 从excel数据源里面取数据。 from: system.address.v1.china # 从data/system/address/v1.xlsx文件中读取名为china的工作簿。 select: city # 查询city字段。 - where: state like '%山东%' # 条件是省份包含山东。 + where: state like '%山东%' # 条件是省份包含山东。 postfix: "\t" - field: field_with_children # 嵌套字段 diff --git a/src/action/generator.go b/src/action/generator.go index ce86054bbfdd66efc1ca60195e0bde4168d3be32..2ffd7d13007039a525a74f9aede59feedef528f8 100644 --- a/src/action/generator.go +++ b/src/action/generator.go @@ -46,7 +46,7 @@ func Generate(defaultFile string, configFile string, total int, fieldsToExportSt entTime := time.Now().Unix() if vari.RunMode == constant.RunModeServerRequest { - logUtils.PrintToWithColor(i118Utils.I118Prt.Sprintf("server_response", len(rows), entTime - startTime), color.FgCyan) + logUtils.PrintTo(i118Utils.I118Prt.Sprintf("server_response", len(rows), entTime - startTime)) } } diff --git a/src/utils/log/print.go b/src/utils/log/print.go index 61facabc16373fe78cf688aadf1e6a9e913577d5..084e39d4d547605b0130c7b45a24366e49240030 100644 --- a/src/utils/log/print.go +++ b/src/utils/log/print.go @@ -55,6 +55,10 @@ func PrintTo(str string) { output := color.Output fmt.Fprint(output, str+"\n") } +func PrintToWithoutNewLine(str string) { + output := color.Output + fmt.Fprint(output, str) +} func PrintToWithColor(msg string, attr color.Attribute) { output := color.Output diff --git a/src/zd.go b/src/zd.go index 075aa0cdff3479efdb8eb89e77677b8225e77e7a..bfb276b732bf15733b0d406c77320930fe3e83de 100644 --- a/src/zd.go +++ b/src/zd.go @@ -242,7 +242,7 @@ func DataHandler(writer http.ResponseWriter, req *http.Request) { fmt.Fprintln(writer, vari.JsonResp) } else if defaultFile != "" || configFile != "" { vari.RunMode = constant.RunModeServerRequest - logUtils.PrintTo(i118Utils.I118Prt.Sprintf("server_request", req.Method, req.URL)) + logUtils.PrintToWithoutNewLine(i118Utils.I118Prt.Sprintf("server_request", req.Method, req.URL)) toGen() }