mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-14 08:51:29 +08:00
optimize(core): avoid useless comparisons in log.lua (#767)
This commit is contained in:
parent
b49b03d863
commit
b3b09240a5
@ -19,12 +19,12 @@ for name, log_level in pairs({stderr = ngx.STDERR,
|
|||||||
warn = ngx.WARN,
|
warn = ngx.WARN,
|
||||||
notice = ngx.NOTICE,
|
notice = ngx.NOTICE,
|
||||||
info = ngx.INFO, }) do
|
info = ngx.INFO, }) do
|
||||||
_M[name] = function(...)
|
if cur_level and log_level > cur_level then
|
||||||
if cur_level and log_level > cur_level then
|
_M[name] = function() end
|
||||||
return
|
else
|
||||||
|
_M[name] = function(...)
|
||||||
|
return ngx_log(log_level, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
return ngx_log(log_level, ...)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user