chore: apply suggestions from code review

Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
This commit is contained in:
zhongwencool 2023-09-20 22:15:39 +08:00 committed by GitHub
parent f789a7504f
commit 9e75ff88af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 8 deletions

View File

@ -203,7 +203,7 @@ do_start_client(InstId, Config = #{url := Server, pool_size := PoolSize, ssl :=
end; end;
{error, {already_started, Pid}} -> {error, {already_started, Pid}} ->
?SLOG(info, #{ ?SLOG(info, #{
msg => "starting_hstreamdb_connector_client_find_old_client_restart client", msg => "starting_hstreamdb_connector_client_find_old_client_restart_client",
old_client_pid => Pid, old_client_pid => Pid,
old_client_name => ClientName old_client_name => ClientName
}), }),

View File

@ -328,7 +328,7 @@ on_query(
{error, {recoverable_error, Reason}}; {error, {recoverable_error, Reason}};
{error, #{status_code := StatusCode}} -> {error, #{status_code := StatusCode}} ->
?SLOG(error, #{ ?SLOG(error, #{
msg => "http_connector_do_request_received_error_response.", msg => "http_connector_do_request_received_error_response",
note => "the body will be redacted due to security reasons", note => "the body will be redacted due to security reasons",
request => redact_request(NRequest), request => redact_request(NRequest),
connector => InstId, connector => InstId,

View File

@ -78,7 +78,7 @@ tcp_keepalive(KeepAlive) ->
Opts; Opts;
{error, {unsupported_os, OS}} -> {error, {unsupported_os, OS}} ->
?SLOG(warning, #{ ?SLOG(warning, #{
msg => "Unsupported_operation_set_TCP_keepalive", msg => "unsupported_operation_set_tcp_keepalive",
os => OS os => OS
}), }),
[] []

View File

@ -220,7 +220,7 @@ login(post, #{body := Params}) ->
Password = maps:get(<<"password">>, Params), Password = maps:get(<<"password">>, Params),
case emqx_dashboard_admin:sign_token(Username, Password) of case emqx_dashboard_admin:sign_token(Username, Password) of
{ok, Token} -> {ok, Token} ->
?SLOG(info, #{msg => "dashboard_login_successfully", username => Username}), ?SLOG(info, #{msg => "dashboard_login_successful", username => Username}),
Version = iolist_to_binary(proplists:get_value(version, emqx_sys:info())), Version = iolist_to_binary(proplists:get_value(version, emqx_sys:info())),
{200, #{ {200, #{
token => Token, token => Token,
@ -239,7 +239,7 @@ logout(_, #{
Username = username(Req, Username0), Username = username(Req, Username0),
case emqx_dashboard_admin:destroy_token_by_username(Username, Token) of case emqx_dashboard_admin:destroy_token_by_username(Username, Token) of
ok -> ok ->
?SLOG(info, #{msg => "dashboard_logout_successfully", username => Username0}), ?SLOG(info, #{msg => "dashboard_logout_successful", username => Username0}),
204; 204;
_R -> _R ->
?SLOG(info, #{msg => "dashboard_logout_failed.", username => Username0}), ?SLOG(info, #{msg => "dashboard_logout_failed.", username => Username0}),

View File

@ -121,7 +121,7 @@ login(post, #{bindings := #{backend := Backend}, body := Sign}) ->
Provider = emqx_dashboard_sso:provider(Backend), Provider = emqx_dashboard_sso:provider(Backend),
case emqx_dashboard_sso:login(Provider, Sign, State) of case emqx_dashboard_sso:login(Provider, Sign, State) of
{ok, Token} -> {ok, Token} ->
?SLOG(info, #{msg => "dashboard_sso_login_successfully", request => Sign}), ?SLOG(info, #{msg => "dashboard_sso_login_successful", request => Sign}),
Version = iolist_to_binary(proplists:get_value(version, emqx_sys:info())), Version = iolist_to_binary(proplists:get_value(version, emqx_sys:info())),
{200, #{ {200, #{
token => Token, token => Token,

View File

@ -92,7 +92,7 @@ register_hook(Rules) ->
ok; ok;
_ -> _ ->
?SLOG(error, #{ ?SLOG(error, #{
msg => "rewrite_rule_re_complie_failed", msg => "rewrite_rule_re_compile_failed",
error_rules => ErrRules error_rules => ErrRules
}), }),
{error, ErrRules} {error, ErrRules}

View File

@ -358,7 +358,7 @@ init_prepare(State = #{prepare_sql := Prepares, pool_name := PoolName, params_to
State#{prepare_sql := Sts}; State#{prepare_sql := Sts};
Error -> Error ->
LogMeta = #{ LogMeta = #{
msg => <<"0racle_init_prepare_statement_failed">>, error => Error msg => <<"oracle_init_prepare_statement_failed">>, error => Error
}, },
?SLOG(error, LogMeta), ?SLOG(error, LogMeta),
%% mark the prepare_sql as failed %% mark the prepare_sql as failed