Browse Source

fix(plugin): refine schema serde log

JimMoen 1 năm trước cách đây
mục cha
commit
c0429ca333

+ 4 - 3
apps/emqx_plugins/src/emqx_plugins_serde.erl

@@ -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