Skip to content

Commit 87dced9

Browse files
committed
Use DEBUG level logging for deprecation warnings
In time, this can be raised but for now DEBUG should be enough to prompt developers.
1 parent e80cca7 commit 87dced9

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

lib/resty/http.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ do
181181
end
182182

183183
function _M.tcp_only_connect(self, ...)
184-
ngx_log(ngx_WARN, "Use of deprecated `connect` method signature")
184+
ngx_log(ngx_DEBUG, "Use of deprecated `connect` method signature")
185185

186186
local sock = self.sock
187187
if not sock then
@@ -1014,7 +1014,7 @@ end
10141014
-- ----------------------------------------------------------------------------
10151015

10161016
function _M.ssl_handshake(self, ...)
1017-
ngx_log(ngx_WARN, "Use of deprecated function `ssl_handshake`")
1017+
ngx_log(ngx_DEBUG, "Use of deprecated function `ssl_handshake`")
10181018

10191019
local sock = self.sock
10201020
if not sock then
@@ -1028,7 +1028,7 @@ end
10281028

10291029

10301030
function _M.connect_proxy(self, proxy_uri, scheme, host, port, proxy_authorization)
1031-
ngx_log(ngx_WARN, "Use of deprecated function `connect_proxy`")
1031+
ngx_log(ngx_DEBUG, "Use of deprecated function `connect_proxy`")
10321032

10331033
-- Parse the provided proxy URI
10341034
local parsed_proxy_uri, err = self:parse_uri(proxy_uri, false)
@@ -1079,7 +1079,7 @@ end
10791079

10801080

10811081
function _M.proxy_request(self, chunksize)
1082-
ngx_log(ngx_WARN, "Use of deprecated function `proxy_request`")
1082+
ngx_log(ngx_DEBUG, "Use of deprecated function `proxy_request`")
10831083

10841084
return self:request({
10851085
method = ngx_req_get_method(),
@@ -1091,7 +1091,7 @@ end
10911091

10921092

10931093
function _M.proxy_response(_, response, chunksize)
1094-
ngx_log(ngx_WARN, "Use of deprecated function `proxy_response`")
1094+
ngx_log(ngx_DEBUG, "Use of deprecated function `proxy_response`")
10951095

10961096
if not response then
10971097
ngx_log(ngx_ERR, "no response provided")

t/11-proxy.t

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ X-Test: foo
6060
--- error_code: 200
6161
--- no_error_log
6262
[error]
63-
--- error_log
6463
[warn]
64+
--- error_log
65+
[debug]
6566

6667

6768
=== TEST 2: Proxy POST request and response
@@ -104,6 +105,8 @@ X-Test: foo
104105
[error]
105106
--- error_log
106107
[warn]
108+
--- error_log
109+
[debug]
107110

108111

109112
=== TEST 3: Proxy multiple headers
@@ -138,8 +141,9 @@ OK
138141
--- error_code: 200
139142
--- no_error_log
140143
[error]
141-
--- error_log
142144
[warn]
145+
--- error_log
146+
[debug]
143147

144148

145149
=== TEST 4: Proxy still works with spaces in URI
@@ -175,5 +179,6 @@ X-Test: foo
175179
--- error_code: 200
176180
--- no_error_log
177181
[error]
178-
--- error_log
179182
[warn]
183+
--- error_log
184+
[debug]

0 commit comments

Comments
 (0)