Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
27f0c4a2
authored
Nov 26, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
e691f13f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
pkg/common/response.go
pkg/logger/mylog.go
pkg/common/response.go
View file @
27f0c4a2
...
...
@@ -48,9 +48,9 @@ func Output(ctx *gin.Context,errCode int, errMsg string, data interface{}) {
ErrMsg
:
errMsg
,
Data
:
data
,
}
if
errCode
>=
100
{
SearchApiLogger
(
ctx
,
errCode
,
errMsg
)
}
//
if errCode >= 100 {
// //
SearchApiLogger(ctx,errCode, errMsg)
//
}
if
ctx
.
DefaultQuery
(
"callback"
,
""
)
!=
""
{
ctx
.
JSONP
(
200
,
response
)
}
else
{
...
...
pkg/logger/mylog.go
View file @
27f0c4a2
...
...
@@ -34,8 +34,8 @@ func Log(writeString string,log_file_pre string,types int) {
date
:=
time
.
Now
()
.
Format
(
"2006-01-02"
)
date2
:=
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
path
,
_
:=
os
.
Getwd
()
CreateDateDir
(
path
,
"
my
logs"
)
var
filename
=
path
+
"/
my
logs/"
+
date
+
log_file_pre
+
".txt"
CreateDateDir
(
path
,
"logs"
)
var
filename
=
path
+
"/logs/"
+
date
+
log_file_pre
+
".txt"
var
f
*
os
.
File
var
err1
error
if
checkFileIsExist
(
filename
)
{
//如果文件存在
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment