Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Roman Lacko
gitlab_api
Commits
552b1f72
Commit
552b1f72
authored
Oct 05, 2016
by
Roman Lacko
Browse files
minor logging fixes
parent
7ca3e09a
Changes
2
Hide whitespace changes
Inline
Side-by-side
GitLab/API.pm
View file @
552b1f72
...
...
@@ -183,7 +183,7 @@ sub clean_data {
my
$data
=
$response
->
decoded_content
;
utf8::
decode
(
$data
);
return
$self
->
json
->
decode
(
$data
);
return
(
$response
,
$self
->
json
->
decode
(
$data
)
)
;
}
#-- Request wrappers ---------------------------------------------------------
...
...
@@ -195,9 +195,12 @@ sub exec_request {
my
$rtargs
=
{
%
{
$args
}{
@rtkeys
}
};
delete
@
{
$args
}{
@rtkeys
};
my
$argstr
=
join
"
,
",
map
{
"
$_
=>
"
.
(
$_
eq
"
password
"
?
"
<redacted>
"
:
"
\"
$args
->{
$_
}
\"
")
}
(
keys
%$args
);
$log
->
debug
("
GitLab::API::
$tmpl
->{name}(
"
.
$argstr
.
"
) called
");
if
(
$log
->
is_debug
)
{
my
$argstr
=
join
"
,
",
map
{
"
$_
=>
"
.
(
$_
eq
"
password
"
?
"
<redacted>
"
:
"
\"
$args
->{
$_
}
\"
")
}
(
keys
%$args
);
my
$rtstr
=
join
"
,
",
map
{
"
$_
=>
$rtargs
->{
$_
}
"
}
(
@rtkeys
);
$log
->
debug
("
called GitLab::API::
$tmpl
->{name}(
$argstr
)
");
$log
->
debug
("
request options: [
$rtstr
]
");
}
my
$uri
=
$self
->
create_uri
(
$tmpl
,
$args
);
...
...
@@ -249,9 +252,9 @@ sub exec_request {
}
if
(
$log
->
is_trace
)
{
$log
->
trace
("
-- HTTP REQUEST
"
,
"
-
"
x
25
,
"
\n
"
,
$response
->
request
->
as_string
);
$log
->
trace
("
-- HTTP RESPONSE
"
,
"
-
"
x
25
,
"
\n
"
,
$response
->
as_string
);
$log
->
trace
("
------------------
",
"
-
"
x
25
);
$log
->
trace
("
--
--
HTTP REQUEST
"
.
(
"
-
"
x
25
)
.
"
\n
"
.
$response
->
request
->
as_string
);
$log
->
trace
("
--
--
HTTP RESPONSE
"
.
(
"
-
"
x
25
)
.
"
\n
"
.
$response
->
as_string
);
$log
->
trace
("
------------------
--
"
.
(
"
-
"
x
25
)
)
;
}
$log
->
debug
("
status:
"
.
$response
->
status_line
);
...
...
GitLab/API/Iterator.pm
View file @
552b1f72
...
...
@@ -120,8 +120,7 @@ sub next_block {
$xurl
->
query_param
(
per_page
=>
$self
->
{
per_page
});
$log
->
debug
("
GET
"
.
$xurl
);
my
$response
=
$self
->
api
->
http
->
get
(
$xurl
);
my
$data
=
$self
->
api
->
clean_data
(
$response
);
my
(
$response
,
$data
)
=
$self
->
api
->
clean_data
(
$self
->
api
->
http
->
get
(
$xurl
));
if
(
$log
->
is_trace
)
{
$log
->
trace
("
---- HTTP REQUEST
"
.
("
-
"
x
25
)
.
"
\n
"
.
$response
->
request
->
as_string
);
...
...
@@ -129,7 +128,7 @@ sub next_block {
$log
->
trace
("
--------------------
"
.
("
-
"
x
25
));
}
$log
->
debug
("
status:
"
,
$response
->
status_line
);
$log
->
debug
("
status:
"
.
$response
->
status_line
);
if
(
!
$response
->
is_success
)
{
$self
->
{
good
}
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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