77
88-module (rabbit_core_ff ).
99
10+ -include_lib (" kernel/include/logger.hrl" ).
11+
12+ -include_lib (" rabbit_common/include/logging.hrl" ).
13+
1014-export ([direct_exchange_routing_v2_enable /1 ,
1115 listener_records_in_ets_enable /1 ,
1216 listener_records_in_ets_post_enable /1 ,
7074-rabbit_feature_flag (
7175 {feature_flags_v2 ,
7276 #{desc => " Feature flags subsystem V2" ,
73- stability => stable
77+ stability => required
7478 }}).
7579
7680-rabbit_feature_flag (
@@ -136,16 +140,18 @@ direct_exchange_routing_v2_enable(#{feature_name := FeatureName}) ->
136140 ok ->
137141 ok = rabbit_binding :populate_index_route_table ();
138142 {error , Err } = Error ->
139- rabbit_log_feature_flags : error (
143+ ? LOG_ERROR (
140144 " Feature flags: `~ts `: failed to add copy of table ~ts to "
141145 " node ~tp : ~tp " ,
142- [FeatureName , TableName , node (), Err ]),
146+ [FeatureName , TableName , node (), Err ],
147+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
143148 Error
144149 end
145150 catch throw :{error , Reason } ->
146- rabbit_log_feature_flags : error (
151+ ? LOG_ERROR (
147152 " Feature flags: `~ts `: enable callback failure: ~tp " ,
148- [FeatureName , Reason ]),
153+ [FeatureName , Reason ],
154+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
149155 {error , Reason }
150156 end .
151157
@@ -169,9 +175,10 @@ listener_records_in_ets_enable(#{feature_name := FeatureName}) ->
169175 throw :{error , {no_exists , rabbit_listener }} ->
170176 ok ;
171177 throw :{error , Reason } ->
172- rabbit_log_feature_flags : error (
178+ ? LOG_ERROR (
173179 " Feature flags: `~ts `: failed to migrate Mnesia table: ~tp " ,
174- [FeatureName , Reason ]),
180+ [FeatureName , Reason ],
181+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
175182 {error , Reason }
176183 end .
177184
@@ -183,16 +190,18 @@ listener_records_in_ets_post_enable(#{feature_name := FeatureName}) ->
183190 {aborted , {no_exists , _ }} ->
184191 ok ;
185192 {aborted , Err } ->
186- rabbit_log_feature_flags : error (
193+ ? LOG_ERROR (
187194 " Feature flags: `~ts `: failed to delete Mnesia table: ~tp " ,
188- [FeatureName , Err ]),
195+ [FeatureName , Err ],
196+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
189197 ok
190198 end
191199 catch
192200 throw :{error , Reason } ->
193- rabbit_log_feature_flags : error (
201+ ? LOG_ERROR (
194202 " Feature flags: `~ts `: failed to delete Mnesia table: ~tp " ,
195- [FeatureName , Reason ]),
203+ [FeatureName , Reason ],
204+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
196205 ok
197206 end .
198207
@@ -204,8 +213,10 @@ tracking_records_in_ets_enable(#{feature_name := FeatureName}) ->
204213 throw :{error , {no_exists , _ }} ->
205214 ok ;
206215 throw :{error , Reason } ->
207- rabbit_log_feature_flags :error (" Enabling feature flag ~ts failed: ~tp " ,
208- [FeatureName , Reason ]),
216+ ? LOG_ERROR (
217+ " Enabling feature flag ~ts failed: ~tp " ,
218+ [FeatureName , Reason ],
219+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
209220 {error , Reason }
210221 end .
211222
@@ -217,8 +228,10 @@ tracking_records_in_ets_post_enable(#{feature_name := FeatureName}) ->
217228 Tab <- rabbit_channel_tracking :get_all_tracked_channel_table_names_for_node (node ())]
218229 catch
219230 throw :{error , Reason } ->
220- rabbit_log_feature_flags :error (" Enabling feature flag ~ts failed: ~tp " ,
221- [FeatureName , Reason ]),
231+ ? LOG_ERROR (
232+ " Enabling feature flag ~ts failed: ~tp " ,
233+ [FeatureName , Reason ],
234+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
222235 % % adheres to the callback interface
223236 ok
224237 end .
@@ -230,8 +243,10 @@ delete_table(FeatureName, Tab) ->
230243 {aborted , {no_exists , _ }} ->
231244 ok ;
232245 {aborted , Err } ->
233- rabbit_log_feature_flags :error (" Enabling feature flag ~ts failed to delete mnesia table ~tp : ~tp " ,
234- [FeatureName , Tab , Err ]),
246+ ? LOG_ERROR (
247+ " Enabling feature flag ~ts failed to delete mnesia table ~tp : ~tp " ,
248+ [FeatureName , Tab , Err ],
249+ #{domain => ? RMQLOG_DOMAIN_FEAT_FLAGS }),
235250 % % adheres to the callback interface
236251 ok
237252 end .
0 commit comments