@@ -148,18 +148,16 @@ wait_for_initial_pass(N) ->
148148 end .
149149
150150setup_proc (
151- #{config := #{exchange := # resource {name = Name ,
152- virtual_host = VHost }}} = Config ) ->
151+ #{config := #{exchange := Exchange }} = Config ) ->
153152 case declare_exchange (Config ) of
154153 ok ->
155154 ? LOG_INFO (
156- " Logging to exchange ' ~ts ' in vhost ' ~ts ' ready" , [Name , VHost ],
155+ " Logging to ~ts ready" , [rabbit_misc : rs ( Exchange ) ],
157156 #{domain => ? RMQLOG_DOMAIN_GLOBAL });
158157 error ->
159158 ? LOG_DEBUG (
160- " Logging to exchange '~ts ' in vhost '~ts ' not ready, "
161- " trying again in ~b second(s)" ,
162- [Name , VHost , ? DECL_EXCHANGE_INTERVAL_SECS ],
159+ " Logging to ~ts not ready, trying again in ~b second(s)" ,
160+ [rabbit_misc :rs (Exchange ), ? DECL_EXCHANGE_INTERVAL_SECS ],
163161 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
164162 receive
165163 stop -> ok
@@ -168,50 +166,45 @@ setup_proc(
168166 end
169167 end .
170168
171- declare_exchange (
172- #{config := #{exchange := # resource {name = Name ,
173- virtual_host = VHost } = Exchange }}) ->
169+ declare_exchange (#{config := #{exchange := Exchange }}) ->
174170 try rabbit_exchange :declare (
175171 Exchange , topic , true , false , true , [], ? INTERNAL_USER ) of
176172 {ok , # exchange {}} ->
177173 ? LOG_DEBUG (
178- " Declared exchange ' ~ts ' in vhost ' ~ts ' " ,
179- [Name , VHost ],
174+ " Declared ~ts " ,
175+ [rabbit_misc : rs ( Exchange ) ],
180176 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
181177 ok ;
182178 {error , timeout } ->
183179 ? LOG_DEBUG (
184- " Could not declare exchange '~ts ' in vhost '~ts ' because the "
185- " operation timed out" ,
186- [Name , VHost ],
180+ " Could not declare ~ts because the operation timed out" ,
181+ [rabbit_misc :rs (Exchange )],
187182 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
188183 error
189184 catch
190185 Class :Reason ->
191186 ? LOG_DEBUG (
192- " Could not declare exchange '~ts ' in vhost '~ts ', "
193- " reason: ~0p :~0p " ,
194- [Name , VHost , Class , Reason ],
187+ " Could not declare ~ts , reason: ~0p :~0p " ,
188+ [rabbit_misc :rs (Exchange ), Class , Reason ],
195189 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
196190 error
197191 end .
198192
199193unconfigure_exchange (
200- #{config := #{exchange := # resource {name = Name ,
201- virtual_host = VHost } = Exchange ,
194+ #{config := #{exchange := Exchange ,
202195 setup_proc := Pid }}) ->
203196 Pid ! stop ,
204197 case rabbit_exchange :ensure_deleted (Exchange , false , ? INTERNAL_USER ) of
205198 ok ->
206199 ok ;
207200 {error , timeout } ->
208201 ? LOG_ERROR (
209- " Could not delete exchange ' ~ts ' in vhost ' ~ts ' due to a timeout" ,
210- [Name , VHost ],
202+ " Could not delete ~ts due to a timeout" ,
203+ [rabbit_misc : rs ( Exchange ) ],
211204 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
212205 ok
213206 end ,
214207 ? LOG_INFO (
215- " Logging to exchange ' ~ts ' in vhost ' ~ts ' disabled" ,
216- [Name , VHost ],
208+ " Logging to ~ts disabled" ,
209+ [rabbit_misc : rs ( Exchange ) ],
217210 #{domain => ? RMQLOG_DOMAIN_GLOBAL }).
0 commit comments