Skip to content

Commit c415dba

Browse files
committed
chore: remove debug logs
1 parent 85d6143 commit c415dba

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

apps/block_scout_web/lib/block_scout_web/views/access_helper.ex

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,43 +81,28 @@ defmodule BlockScoutWeb.AccessHelper do
8181

8282
user_agent = get_user_agent(conn)
8383

84-
Logger.info("--> ip: #{inspect(ip_string)} <--")
85-
Logger.info("--> token: #{inspect(token)} <--")
86-
Logger.info("--> user_agent: #{inspect(user_agent)} <--")
87-
Logger.info("--> plan: #{inspect(plan)} <--")
84+
Logger.info("request ip: #{inspect(ip_string)}")
8885

8986
cond do
9087
check_api_key(conn) && get_api_key(conn) == static_api_key ->
91-
Logger.info("check api key")
9288
rate_limit(static_api_key, limit_by_key, time_interval_limit)
9389

9490
check_api_key(conn) && !is_nil(plan) ->
95-
Logger.info("check api key with a plan")
96-
9791
conn
9892
|> get_api_key()
9993
|> rate_limit(plan.max_req_per_second, time_interval_limit)
10094

10195
Enum.member?(whitelisted_ips(rate_limit_config), ip_string) ->
102-
Logger.info("check whitelisted ip")
103-
Logger.info("--> ip_string: #{inspect(ip_string)} <--")
104-
r = rate_limit(ip_string, limit_by_whitelisted_ip, time_interval_limit)
105-
Logger.info("whitelist IP result: #{inspect(r)} <--")
106-
r
96+
rate_limit(ip_string, limit_by_whitelisted_ip, time_interval_limit)
10797

10898
api_v2_request?(conn) && !is_nil(token) && !is_nil(user_agent) ->
109-
Logger.info("check apiv2 with token & user_agent")
11099
rate_limit(token, api_v2_ui_limit, time_interval_limit)
111100

112101
api_v2_request?(conn) && !is_nil(user_agent) ->
113-
Logger.info("check apiv2 with token")
114102
rate_limit(ip_string, limit_by_ip, time_interval_by_ip)
115103

116104
true ->
117-
Logger.info("check default rate")
118-
r = rate_limit("api", global_limit, time_interval_limit)
119-
Logger.info("default result: #{inspect(r)} <--")
120-
r
105+
rate_limit("api", global_limit, time_interval_limit)
121106
end
122107
end
123108

0 commit comments

Comments
 (0)