@@ -148,18 +148,16 @@ wait_for_initial_pass(N) ->
148
148
end .
149
149
150
150
setup_proc (
151
- #{config := #{exchange := # resource {name = Name ,
152
- virtual_host = VHost }}} = Config ) ->
151
+ #{config := #{exchange := Exchange }} = Config ) ->
153
152
case declare_exchange (Config ) of
154
153
ok ->
155
154
? LOG_INFO (
156
- " Logging to exchange ' ~ts ' in vhost ' ~ts ' ready" , [Name , VHost ],
155
+ " Logging to ~ts ready" , [rabbit_misc : rs ( Exchange ) ],
157
156
#{domain => ? RMQLOG_DOMAIN_GLOBAL });
158
157
error ->
159
158
? 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 ],
163
161
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
164
162
receive
165
163
stop -> ok
@@ -168,50 +166,45 @@ setup_proc(
168
166
end
169
167
end .
170
168
171
- declare_exchange (
172
- #{config := #{exchange := # resource {name = Name ,
173
- virtual_host = VHost } = Exchange }}) ->
169
+ declare_exchange (#{config := #{exchange := Exchange }}) ->
174
170
try rabbit_exchange :declare (
175
171
Exchange , topic , true , false , true , [], ? INTERNAL_USER ) of
176
172
{ok , # exchange {}} ->
177
173
? LOG_DEBUG (
178
- " Declared exchange ' ~ts ' in vhost ' ~ts ' " ,
179
- [Name , VHost ],
174
+ " Declared ~ts " ,
175
+ [rabbit_misc : rs ( Exchange ) ],
180
176
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
181
177
ok ;
182
178
{error , timeout } ->
183
179
? 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 )],
187
182
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
188
183
error
189
184
catch
190
185
Class :Reason ->
191
186
? 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 ],
195
189
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
196
190
error
197
191
end .
198
192
199
193
unconfigure_exchange (
200
- #{config := #{exchange := # resource {name = Name ,
201
- virtual_host = VHost } = Exchange ,
194
+ #{config := #{exchange := Exchange ,
202
195
setup_proc := Pid }}) ->
203
196
Pid ! stop ,
204
197
case rabbit_exchange :ensure_deleted (Exchange , false , ? INTERNAL_USER ) of
205
198
ok ->
206
199
ok ;
207
200
{error , timeout } ->
208
201
? 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 ) ],
211
204
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
212
205
ok
213
206
end ,
214
207
? LOG_INFO (
215
- " Logging to exchange ' ~ts ' in vhost ' ~ts ' disabled" ,
216
- [Name , VHost ],
208
+ " Logging to ~ts disabled" ,
209
+ [rabbit_misc : rs ( Exchange ) ],
217
210
#{domain => ? RMQLOG_DOMAIN_GLOBAL }).
0 commit comments