fix(plugin): refine schema serde log

This commit is contained in:
JimMoen 2024-04-24 17:38:35 +08:00
parent 27d1f91cac
commit c0429ca333
No known key found for this signature in database
1 changed files with 4 additions and 3 deletions

View File

@ -62,16 +62,17 @@ lookup_serde(SchemaName) ->
add_schema(Name, Avsc) -> add_schema(Name, Avsc) ->
case lookup_serde(Name) of case lookup_serde(Name) of
{ok, _Serde} -> {ok, _Serde} ->
?SLOG(warning, #{msg => "plugin_avsc_schema_already_exists", name_vsn => Name}), ?SLOG(warning, #{msg => "plugin_schema_already_exists", plugin => Name}),
{error, already_exists}; {error, already_exists};
{error, not_found} -> {error, not_found} ->
case gen_server:call(?MODULE, {build_serdes, to_bin(Name), Avsc}) of case gen_server:call(?MODULE, {build_serdes, to_bin(Name), Avsc}) of
ok -> ok ->
?SLOG(debug, #{msg => "plugin_avsc_schema_added", name_vsn => Name}), ?SLOG(debug, #{msg => "plugin_schema_added", plugin => Name}),
ok; ok;
{error, Reason} = E -> {error, Reason} = E ->
?SLOG(error, #{ ?SLOG(error, #{
msg => "plugin_avsc_schema_added_failed", msg => "plugin_schema_add_failed",
plugin => Name,
reason => emqx_utils:readable_error_msg(Reason) reason => emqx_utils:readable_error_msg(Reason)
}), }),
E E