Merge pull request #11726 from zhongwencool/audit-cli-args-bin
fix: cli's args in audit log should be array
This commit is contained in:
commit
4898d2377b
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_ctl, [
|
{application, emqx_ctl, [
|
||||||
{description, "Backend for emqx_ctl script"},
|
{description, "Backend for emqx_ctl script"},
|
||||||
{vsn, "0.1.4"},
|
{vsn, "0.1.5"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_ctl_app, []}},
|
{mod, {emqx_ctl_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -331,13 +331,14 @@ safe_to_existing_atom(Str) ->
|
||||||
is_initialized() ->
|
is_initialized() ->
|
||||||
ets:info(?CMD_TAB) =/= undefined.
|
ets:info(?CMD_TAB) =/= undefined.
|
||||||
|
|
||||||
audit_log(Level, From, Log) ->
|
audit_log(Level, From, Log = #{args := Args}) ->
|
||||||
case lookup_command(audit) of
|
case lookup_command(audit) of
|
||||||
{error, _} ->
|
{error, _} ->
|
||||||
ignore;
|
ignore;
|
||||||
{ok, {Mod, Fun}} ->
|
{ok, {Mod, Fun}} ->
|
||||||
try
|
try
|
||||||
apply(Mod, Fun, [Level, From, Log])
|
Log1 = Log#{args => [unicode:characters_to_binary(A) || A <- Args]},
|
||||||
|
apply(Mod, Fun, [Level, From, Log1])
|
||||||
catch
|
catch
|
||||||
_:Reason:Stacktrace ->
|
_:Reason:Stacktrace ->
|
||||||
?LOG_ERROR(#{
|
?LOG_ERROR(#{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_dashboard, [
|
{application, emqx_dashboard, [
|
||||||
{description, "EMQX Web Dashboard"},
|
{description, "EMQX Web Dashboard"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.28"},
|
{vsn, "5.0.29"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_dashboard_sup]},
|
{registered, [emqx_dashboard_sup]},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -70,7 +70,7 @@ admins(_) ->
|
||||||
unload() ->
|
unload() ->
|
||||||
emqx_ctl:unregister_command(admins).
|
emqx_ctl:unregister_command(admins).
|
||||||
|
|
||||||
bin(S) -> iolist_to_binary(S).
|
bin(S) -> unicode:characters_to_binary(S).
|
||||||
|
|
||||||
print_error(Reason) when is_binary(Reason) ->
|
print_error(Reason) when is_binary(Reason) ->
|
||||||
emqx_ctl:print("Error: ~s~n", [Reason]).
|
emqx_ctl:print("Error: ~s~n", [Reason]).
|
||||||
|
|
Loading…
Reference in New Issue