Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai-api-mgr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
ai-api-mgr
Commits
04d93dd6
Commit
04d93dd6
authored
Mar 19, 2024
by
Cloud User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log output
parent
46de9e87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
main.go
main.go
+22
-2
No files found.
main.go
View file @
04d93dd6
...
...
@@ -981,7 +981,7 @@ func main() {
// baseAttributes := []slog.Attr{}
// baseAttributes = append(baseAttributes, slog.String(TaskIdAtrr, taskId))
newAttributes
:=
append
(
baseAttributes
,
slog
.
Int
(
"resAsPb.TaskResultCode"
,
int
(
res
.
TaskResultCode
)),
slog
.
String
(
"TaskResultHeader"
,
string
(
res
.
TaskResultHeader
)))
newAttributes
:=
append
(
baseAttributes
,
slog
.
Int
(
"resAsPb.TaskResultCode"
,
int
(
res
.
TaskResultCode
)),
slog
.
String
(
"TaskResultHeader"
,
string
(
res
.
TaskResultHeader
))
,
slog
.
String
(
"TaskResultBody"
,
string
(
res
.
TaskResultBody
))
)
slog
.
LogAttrs
(
c
.
UserContext
(),
slog
.
LevelInfo
,
"getAsyncRes"
,
newAttributes
...
)
...
...
@@ -1274,7 +1274,7 @@ func syncModeF(c *fiber.Ctx, taskid string) error {
baseAttributes
:=
[]
slog
.
Attr
{}
baseAttributes
=
append
(
baseAttributes
,
slog
.
String
(
TaskIdAtrr
,
taskid
))
newAttributes
:=
append
(
baseAttributes
,
slog
.
Int
(
"resAsPb.TaskResultCode"
,
int
(
resAsPb
.
TaskResultCode
)),
slog
.
String
(
"TaskResultHeader"
,
string
(
resAsPb
.
TaskResultHeader
)))
newAttributes
:=
append
(
baseAttributes
,
slog
.
Int
(
"resAsPb.TaskResultCode"
,
int
(
resAsPb
.
TaskResultCode
)),
slog
.
String
(
"TaskResultHeader"
,
string
(
resAsPb
.
TaskResultHeader
))
,
slog
.
String
(
"TaskResultBody"
,
string
(
resAsPb
.
TaskResultBody
))
)
slog
.
LogAttrs
(
c
.
UserContext
(),
slog
.
LevelInfo
,
"syncModeF"
,
newAttributes
...
)
...
...
@@ -1310,16 +1310,36 @@ func syncOrAsyncReturn(c *fiber.Ctx, resAsPb pbUpstream.TaskResponse, reqTaskId
for
_
,
v
:=
range
vs
{
if
k
==
"Content-Encoding"
{
newAttributes
:=
append
(
baseAttributes
,
slog
.
String
(
k
,
v
),
)
slog
.
LogAttrs
(
c
.
UserContext
(),
slog
.
LevelInfo
,
"http Content-Encoding header in body"
,
newAttributes
...
)
c
.
Response
()
.
Header
.
SetContentEncoding
(
v
)
}
if
k
==
"Content-Type"
{
newAttributes
:=
append
(
baseAttributes
,
slog
.
String
(
k
,
v
),
)
slog
.
LogAttrs
(
c
.
UserContext
(),
slog
.
LevelInfo
,
"http Content-Type header in body"
,
newAttributes
...
)
c
.
Response
()
.
Header
.
SetContentType
(
v
)
}
if
redirectCode
{
if
k
==
"Location"
{
newAttributes
:=
append
(
baseAttributes
,
slog
.
String
(
k
,
v
),
slog
.
Int
(
"resAsPb.TaskResultCode"
,
int
(
resAsPb
.
TaskResultCode
)),
)
slog
.
LogAttrs
(
c
.
UserContext
(),
slog
.
LevelInfo
,
"http location header in body"
,
newAttributes
...
)
c
.
Redirect
(
v
,
int
(
resAsPb
.
TaskResultCode
))
//c.Response().Header.SetL
...
...
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